|
-
Aug 24th, 2001, 02:51 AM
#1
Thread Starter
Lively Member
Deployment doubt...
Hello all,
Im packaging my project with my database sitting in Apppath\data\db.mdb.
For the connection string, I'm using the server's name with the path of my .mdb file. eg. '\\machine1\c\vb\data\insurance.mdb'
If the installation is installed in another machine, then, my code won't work because of the wrong server path (\\machine1).
To make my connection string general what should be done??
Thanx in advance
-
Aug 24th, 2001, 03:16 AM
#2
Thread Starter
Lively Member
pls help...
-
Aug 24th, 2001, 03:22 AM
#3
Lively Member
Instead of hard coding the location of your .mdb file, change the directory to App.Path. App is a VB Object pointing to itself and the Property Path is its location. You could do the same for your Connection String though I think you'd have to do it manually and not through a DataEnvironment.
Just to make sure your .mdb file exists so that you won't get an error when you try to access the DB, use the Scripting Runtime to check for the file's existence.
Hope this helps.
-
Aug 24th, 2001, 03:32 AM
#4
Thread Starter
Lively Member
Thanx for that,
1. Im using Apppath already. What i want to know is the server's name. My server's (where db resides) name is hard-coded now. I want to automatically check and put the server's name.
2. How do i use the scripting runtime?
Thanx again
-
Aug 24th, 2001, 08:02 AM
#5
PowerPoster
You should user a sort of options screen that allows the user to change the location, so it knows where to look. You can't really auto-detect...
As for the scripting thing, goto Projects->References and check Microsoft Scripting Runtime
-
Aug 25th, 2001, 03:23 AM
#6
Thread Starter
Lively Member
So, Can I use a form which would ask for the machine name and then use this machine name in the setup dynamically.
Cheers
-
Aug 25th, 2001, 09:31 AM
#7
PowerPoster
yep...ask for the machine name, store it somewhere, registry maybe, then use something like this
VB Code:
strPathtoFile = "\\" & strMachineNameFromReg & "\c\somepath\something.txt"
-
Aug 25th, 2001, 10:47 AM
#8
Thread Starter
Lively Member
1. How do I store a variable in the registry and retrive the same variable's value into vb.
2. How to include the form in the PDWizard.
-
Aug 25th, 2001, 01:14 PM
#9
are you using access???
cause if you are using access you can use the registry to store the name of the server.
the program would look for the server, and if the server is not found would ask the user to type the name of the server and save that info in tge registry.
you can use a ini file too.
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
|