Results 1 to 3 of 3

Thread: MS Access VB 6.0 DB connect using API

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Location
    chennai
    Posts
    1

    Question MS Access VB 6.0 DB connect using API

    Iam using VB 6.0, MS Access as Data base.
    I Want to connect Access using API from VB, with out using DSN.
    How to do it. Hence i can install in any system, any directory with out creating dsn in that system.

    I also dont want to give the path like ..

    c:\somepath\mydb.mdb
    since , If i install the program in D:/different Path.access.mdb,
    It will say that .mdb does not exixt.

    I want it using Windows API functions only.
    Last edited by mmvraja; Feb 13th, 2003 at 05:34 AM.

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    You don't need a DSN to connect to a database.

    VB Code:
    1. Dim oConn As ADODB.Connection
    2.  
    3. Set oConn = New ADODB.Connection
    4. oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
    5.            "Dbq=c:\somepath\mydb.mdb;" & _
    6.            "Uid=admin;" & _
    7.            "Pwd="

  3. #3
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    DAO library is also very handy tool when working with MS Access (specifically when db is local).
    McGenius

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