CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Posts
    4

    Changing ADODC connection string at runtime

    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?



  2. #2
    Join Date
    Mar 2001
    Location
    County Durham, England
    Posts
    238

    Re: Changing ADODC connection string at runtime

    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 . . .


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured