Accessing data sources without creating it in ODBC Administrator


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Accessing data sources without creating it in ODBC Administrator

Hybrid View

  1. #1
    Bryan Guest

    Accessing data sources without creating it in ODBC Administrator


    In vb, how can I get access to data sources that are in sql server without
    adding it to the ODBC Data Source Administrator?

  2. #2
    Joel Ryan Guest

    Re: Accessing data sources without creating it in ODBC Administrator

    If you mean connecting to a data source without using a DSN, you can do it
    with ADO. Here's an example:

    Dim oConn as New ADODB.Connection

    ' For SQL Server:
    sDataSource = "Driver={SQL Server};server=myserver;database=mydatabase;"

    ' For an MDB:
    sDataSource = "Driver={Microsoft Access Driver
    (*.mdb)};dbq=c:\myaccessdatabase.mdb"

    oConn.Open sDataSource

    -- Joel


    Bryan wrote:

    > In vb, how can I get access to data sources that are in sql server without
    > adding it to the ODBC Data Source Administrator?



  3. #3
    Joel Ryan Guest

    Re: Accessing data sources without creating it in ODBC Administrator

    If you mean connecting to a data source without using a DSN, you can do it
    with ADO. Here's an example:

    Dim oConn as New ADODB.Connection

    ' For SQL Server:
    sDataSource = "Driver={SQL Server};server=myserver;database=mydatabase;"

    ' For an MDB:
    sDataSource = "Driver={Microsoft Access Driver
    (*.mdb)};dbq=c:\myaccessdatabase.mdb"

    oConn.Open sDataSource

    -- Joel


    Bryan wrote:

    > In vb, how can I get access to data sources that are in sql server without
    > adding it to the ODBC Data Source Administrator?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center