Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Change of ADO connectionstring (again)

Status
Not open for further replies.

Knutjo

Programmer
Jan 15, 2002
31
NO
When you create a form (design time) i VB with ADODC (against Access) you have to give the full path to database you want to connect to. The path is saved with the form and as a part of the connectionstring.

At the "end user site" the path to database will be different from design time and I need to change that at runtime. I'm able to do that, but I allways get an errormessage that says "Can't find "oldpath\database.mdb". What can I do to make that message dissapear ?


Thanks
 
Ok, so you got what you need. Why don't you use "On Error Resume Next" to ignore that err msg???
 
Yes! I have tried that, but I get this errormessage before "form_load"-event and I don't know where I can hook into the program and stop this message.

Any ideas ?
 
Delete the path from the ado control and set it up when the form loads. Peter Meachem
peter@accuflight.com
 
....and the tips from "petermeachem" means that when I have finished the developing process I have to change/remove all the paths in the VB-project before final compile/make.

I haven't tried it yet, but I think the errormessage will disapear.

To me it seem strange that you can't override the connectionstring at runtime without removing the paths from the VB project.

Anyway... thanks for your help !






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top