Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Location
    Lincolnshire, England
    Posts
    2

    Red face Unanswered: Datebase Connection with Access 2000/2003 and Visual Basic 6

    Is it possible to make a connection between Microsoft Access 2000/2003 and Visual Basic 6? I know that i can't use DAO as that requires Access 97 and i was just wondering if there was anyother way?

  2. #2
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346
    Here is some sample code to connect to an Access Database using VB and ADO:

    Code:
    Dim cn as ADODB.Connection
    Dim rs as ADODB.Recordset
    
    Set cn = new ADODB.Connection
    cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Password=TestPass;Data Source=C:\Test.mdb;Persist Security Info=False;Exclusive=0"
    cn.open
    
    set rs = new ADODB.recordset
    rs.ActiveConnection = cn
    rs.Open "SELECT * FROM Table1"
    
    rs.Close
    cn.Close
    Set rs=Nothing
    Set cn = Nothing
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

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