Click to See Complete Forum and Search --> : Changing ADODC connection string at runtime


Yan Pelletier
March 22nd, 2001, 10:33 AM
If the connectionString property of an ADODC is empty when a form is opening, you get a dialog "Microsoft ODBC Driver Manager - Data source name not found and no default driver specified.

You cannot stop this dialog from coming up. At least I cannot, unless there is a valid connection string already set.

I can change the connection string if a valid one is already there, but I need to acces only one MDB with a name that is not always the same... I don't want to create a dummy MDB to prevent the probem from happening!

Is there anyway to do this?

Judgey
March 22nd, 2001, 11:04 AM
hi Yan,

if you have a look at the code I've just put in Aaron Croasmun Problem with the recordset, I use this code but substitute the < Database Name > section with a string containing a database name selected from a File CommonDialog, so you could use the FileDir to obtain any *.MDBs in a particular directory to fill the string , if you get my meaning . . .