Question data source path name...

mega1987

Member
Joined
May 25, 2009
Messages
7
Programming Experience
Beginner
is there's a way for vb program to auto-search for it's database, regardless of it's current location and disk?

please tell me if is possible or not... if it's possible, can you show how it is done?
 
Normally you should specify the folder containing the database as |DataDirectory| in the connection string, e.g. "Data Source=|DataDirectory|\MyDatabase.mdb" and that will resolve to the correct location at run time. While debugging it will resolve to the same folder as the EXE was run from.

Once released, it depends how you deployed your as to what path |DataDirectory| resolves to. If you just copied the EXE then it's the same as when debugging. If you used ClickOnce then ClickOnce will manage that and you don't have to worry.
 

Latest posts

Back
Top