cannot get rid of mapped drive reference

UdiHrant

Member
Joined
Jul 3, 2012
Messages
9
Programming Experience
10+
When I wrote a program recently I created a connection string that used a mapped drive reference.

I only realized this when I went to 'publish' the application to my users on a Novell network. When the user goes to install the application locally I get a .NET error stating that the data resource cannot be found for them:

[System.Data.OleDb.OleDbException (0x80004005):Could not find file "G:\shared\caspa.accdb]

I have gone back into my VB compiler and fixed this or thought I fixed it by using a true, full network path and then re-published the application but the reference to the mapped drive continues to appear!

Can anyone help me clean this up so that I don't have to rewrite the whole thing? I've searched though all of my code and there is no reference to a 'G' drive so it must be hidden in a connection string that I can't find.

Thanks for any help.
 
I'm going to guess that you used the wizard to generate a typed DataSet from your database; correct? If so then the connection string is stored in the config file. That's the only place you ever have to change it after that. The whole point of storing it there is so that users can change it by hand after deployment.
 
I'm going to guess that you used the wizard to generate a typed DataSet from your database; correct? If so then the connection string is stored in the config file. That's the only place you ever have to change it after that. The whole point of storing it there is so that users can change it by hand after deployment.

You are correct. I made the mistake in the add dataset wizard. However - when looking into my app.config file I see that I HAVE made the correction and somwhere the drive letter reference still keeps popping up upon deployment. I have bolded the corrected path below. Any other ideas of where to look?

<connectionStrings>
<add name="Ad_Import_Win.My.MySettings.TmsEPrdConnectionString"
connectionString="Data Source=jenprod;Initial Catalog=TmsEPrd;Persist Security Info=True;User ID=sa;Password=jenzabar"
providerName="System.Data.SqlClient" />
<add name="Ad_Import_Win.My.MySettings.ConnectionString" connectionString="Dsn=caspa;dbq=G:\SHARED\JenX\ADMISSIONS\Static.mdb;driverid=25;fil=MS Access;maxbuffersize=2048;pagetimeout=5"
providerName="System.Data.Odbc" />
<add name="Ad_Import_Win.My.MySettings.Static_Caspa" connectionString="Dsn=Static_Caspa"
providerName="System.Data.Odbc" />
<add name="Ad_Import_Win.My.MySettings.caspaConnectionString"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\caspa.mdb"
providerName="System.Data.OleDb" />
<add name="Ad_Import_Win.My.MySettings.optomcasConnectionString"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\optomcas.mdb"
providerName="System.Data.OleDb" />
<add name="Ad_Import_Win.My.MySettings.CASPAConnectionString1"
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\elkins\vol2\SHARED\JenX\ADMISSIONS\CASPA.accdb"
providerName="System.Data.OleDb" />
</connectionStrings>
 
So - here's how far I've gotten. I added a new data source to replace the bad one and this time corrected the wizard to include a full network path. Then I replaced all references to the bad Datasource in my code. After that I attempted to delete the bad data source from my project but from within the 'Data Source Window' there is no delete option.

How can I rid myself of all references to a particular datasource from the entire project?

The program runs now but I can't deploy it as long as that datasource exists with the bad path.
 
Back
Top