Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distributed Database Program

Status
Not open for further replies.

hojo

Computer
Oct 9, 2002
18
Hello All,

I am creating a catalogue in VB6. All of the data is stored in an Access database which is linked to some data bound controls through an ADODC Control.

The Program works "Perfectly" except for one thing. This program will be used on multiple computers therefore the Path of the database will be different on different computers (ie. some CD-ROM drives are D: some are E: and if its put onto the harddrive then it could be anything!)

I can change the ConnectionString of the ADODC Control to find the new path once the program starts, but while the program is loading i receive error messages for each ADODC Control stating that the database can't be found

I need to bypass this error message so my program can update the database path without the user having to press "OK" 40 times.

Any help would be appreciated.

Cheers,

HOJO
 
Replies continue below

Recommended for you

Store your database in the same directory as the application, then use App.Path to point to it.

App.Path always refers to the directory that the application is running from.

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting
 
Thank you johnwm, but that part i'm ok with. I can track down the correct path (using app.path) and change the connection string of the database.

The problem i'm having is that i can only do this once the program is running, but the error message for not finding the database comes up when LOADING the program.

If i can stop this error message coming up then the database can find its path without the user knowing there was a problem.

Thanks again

HOJO

P.S "On Error GoTo Next" doesn't work as it appears the error is being generated "outside" of my program.

Cheers!!!
 
This is one of the problems with using bound controls and the ADODC control - not much control!

Try setting up an ADODB connection object for your connection and an ADODB recordset for your Datasource. There are examples of both in Help

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor