Results 1 to 3 of 3

Thread: ADO Connection String

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Taipei
    Posts
    318

    Cool

    I have setup a system DSN (have the server IP address, DB Name etc) and used in the ADO connection

    ADO.Open "DSN=xxx",

    If the user do not have this DSN installed, then it cannot be run.

    My question is :

    How should I change the statement, so that I can hard code the IP address, DB name etc in the ADO.Open statement

    Thanks for any hint



  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    ADO.Open "Provider=[provider name];Driver={driver name};Server=[server];Database=[database];Uid=[userid];Pwd=[password];"

    eg; for a SQL server database

    ADO.Open "Provider=SQLOLEDB;Driver={SQL Server};Server=MYSERVER;Database=MYDB;Uid=SA;Pwd=;"

    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3
    New Member
    Join Date
    Jun 2000
    Posts
    3

    DSN/ADO Connection string

    It may seem a little obvious, but as an addition to to the previous post, you can set up an 'Options' form where the server ip etc. is set by the user. Alternatively use the registry, or even a remote path. Just a couple of idea to make the program more flexible.

    Matt

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