Click here to Skip to main content
16,020,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I load my application on client machine,
I get the following error:
g:\database\hello.mdb is not valid path.

There is no g: drive on the client computer, so I dont have a easy idea for it.

like::
something\hello.mdb
Posted
Updated 28-Sep-10 0:08am
v2

From your question it looks like you have the path to the DB hard coded. Always a bad idea.

One way to resolve this is to error check on the DB access and if not found put up a FolderBrowser for the user to navigate to the proper location. Then store that location in the config file/registry/wherever ready for next time.
 
Share this answer
 
Comments
Simon_Whale 28-Sep-10 12:15pm    
good answer :)
The easiest thing to to would be to use a settings file, and then configure the relevant path in there.

Then in the code you would reference the settings parameter, so it would never need the code changing.

http://www.devsource.com/c/a/Languages/VBNET-Using-MySettings-for-Application-Settings/[^]
 
Share this answer
 
You'll have to use a application setting to do this.
Or some other way to store the path to your database.

Or you can opt to put the database in a common folder at installation and use that one. (but this is not recommended for a database)

Take a look at these links:

http://articles.techrepublic.com.com/5100-10878_11-5779516.htm[^]

http://msdn.microsoft.com/en-us/library/a65txexh(v=vs.80).aspx[^]

http://www.ezzylearning.com/tutorial.aspx?tid=806732[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900