|
-
Oct 3rd, 2000, 10:20 AM
#1
Thread Starter
Member
Bear with me here....It's going to be a tough explanation.
I have a VB program that uses an access backend to store data. What I am trying to do is avoid hard coding the location of the database directly into VB (in case the location of the program changes). For instance, I am using this program in 2 different offices. So I had to create 2 different exe files, one with the path for office A and the other for the path of office B. What I am hoping to do is install the database in the same folder with the exe and everything run ok without hard coding the location.
Please let me know if this is possible.
Thanks!!!!
-
Oct 3rd, 2000, 10:29 AM
#2
Frenzied Member
Is the filename constant? (name.mdb?) then you could just do
open App.Path & "\name.mdb" for....
so it's the app.path that does the trick! it seeks in the directory of your exe.
If you don't know you can make a .txt file in the dir of your exe, write the path & file in there (c:\myfiles\db.mdb)
manually (notepad is the secret word )
then in your prog open the txt file, extract the path & filename, then use that string to open the database.
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 3rd, 2000, 10:33 AM
#3
Thread Starter
Member
The name stays constant. So in my connection string I could make it something like:
ConnectionString = ....Source=\name.mdb"
instead of:
ConnectionString = "Provider=Microsoft.JET.OLEDB.4.0;Data Source=C:\My Documents\name.mdb"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|