472,145 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

Customize Database Path

My inventory app has an Access database that will need to reside on a
Mapped Network Drive. It is unknown where the path will be until the
application is installed. I was thinking I could make a Tools form to allow
the user to select where the DB resides then I wouldn't have to recompile
the program if the DB ever moves to a different location.
I am using VB.NET 2005. I used the Add Data Source Wizard which created
my ConnectionString with Application scope. Because it is a ReadOnly
Property I cannot modify the connection string by using a Set.

In my bin directory, I have a file named Inventory.exe.config that
contains the following:

<connectionStrings>
<add
name="Inventory.My.MySettings.Inventory_management _databaseConnectionString"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data
Source=&quot;|DataDirectory|\Inventory Management database.mdb&quot;"
providerName="System.Data.OleDb" />
</connectionStrings>
These files in my project contain the connection string with the path.
app.config Resources.resx Settings.Designer.vb

How do I allow the user to set the path and save the path at Runtime?

Thank you in advance,
Tony K

Jul 26 '07 #1
0 843

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Chris Kilmer | last post: by
3 posts views Thread by gruber | last post: by
1 post views Thread by Gianmaria | last post: by
1 post views Thread by Rachel | last post: by
Iman100
reply views Thread by Iman100 | last post: by
13 posts views Thread by Prisoner at War | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.