|
-
Aug 4th, 1999, 11:23 AM
#1
Thread Starter
Addicted Member
I am creating a system which reads an ACCESS database and processes data on several different forms, using various types of data control (Adodc1, Data1 etc.)
How can I set the Connection srting(s) at design time to look at the IniFile settings "Datapath", so I can distribute the app and have it dynamically point to the correct database?
Help please as I'm going crazy trying to figure this out!
-
Aug 5th, 1999, 04:51 PM
#2
Lively Member
First off... you probably don't want to use an INI file. If the file gets damaged or lost, your program just doesn't work. Why not have the database install in the directory with the application, so you can use App.Path? Then it won't matter where the user installs your app, as long as they install it all together.
As far as setting data paths at runtime, just make sure you do not set any data paths for your data controls at design time. They should all be blank. This will prevent your from 'forgetting' to set one of them, or some of the related properties for bound controls. Many times I've tested thoroughly, only to find things blowing up once the application was installed on a new machine because a data path was still looking for a file in a location that only existed on my hard drive.
Set the databasename property of the data control and then refresh the connection.
Bash
-
Aug 6th, 1999, 12:45 AM
#3
Frenzied Member
I would disagree about using a .ini file. They're very small and if you have any kind of source control, very easy to recover. If one gets corrupted (or deleted) it's very easy (and quick) to pop one in the mail.
When using bound controls, I agree with you. I only set the database name long enough to retrieve fields and then I *always* reset it to blank.
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
|