View Single Post
Old 11-23-2005, 09:01 AM   #2 (permalink)
Joel Egghead
Registered User
 
Join Date: Oct 2005
Posts: 5
Joel Egghead is on a distinguished road
Ok the problem with the Database directory…if you don’t have a server to work from…that would be the most ideal because the location wont change and all of the network users would be able to connect to it, but if you don’t have a server and only have one user who is changing the data, I would do this by putting a subfolder in the program folder named “Database” or “Data” and I put the Access database in that folder. Now to get connected to that data during the debugging process I would put a “dummy” folder on your C: drive that’s named the same as your program folder and put the data folder with a copy of your database in that dummy folder and you can do your programming and when you have made your EXE place your real database folder in the real Program folder and ether delete the dummy one or save over it. This will allow you to test your work in the location it really will exist and Im guessing that’s why your debugging works but your exe file wont because its trying to get to a folder it has no way to get to. One key to this is having it install into a folder every one has…for example you may have the folder :
Public Const gDataBaseName = "C:\Documents and Settings\Apollo\My Documents
But when you install it to someone elses machine they will have a something similar to:
C:\ Documents and Settings\Joel\My Documents
Your best way to avoid this problem is to have your program install on the base level of C:
For example -
Your program Directory would be : C:\YourProgramName\Name.exe
And you would have a directory : C:\ YourProgramName\Database\MyData.mbd
The code would look like this to connect to the database:
Public Const gDataBaseName = " C:\ YourProgramName\Database\MyData.mbd"
I hope this helps!
Joel Egghead is offline   Reply With Quote