Results 1 to 2 of 2

Thread: ADO Connection String

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Im used to working with DAO and now im trying to
    slide over to the ADO side but i cant seem to get
    the connection string right. Any suggestions would be
    greatly appreciated. I keep seeing
    Set connection = CurrentProject.Connection but
    CurrentProject is a object off of the Application
    object in VBA which i cant access from vb it self
    so what do i do?

    Option Explicit
    Dim connection As New ADODB.connection
    Dim fieldcurr As ADODB.Field
    Dim ourtables As New ADOX.Table
    Dim catcurr As New ADOX.Catalog
    Dim rs As New ADODB.Recordset

    Private Sub Command1_Click()
    rs.Open "Account Information"
    For Each fieldcurr In rs.Fields
    Debug.Print fieldcurr.Name
    rs.MoveNext
    Next fieldcurr
    End Sub

    Private Sub Form_Load()
    connection.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = C:\SoilTicketdb.mdb"

  2. #2
    Lively Member Surgeon's Avatar
    Join Date
    Oct 2000
    Posts
    121
    You could make a hop there :
    http://msdn.microsoft.com/library/ps...k/mdap99m7.htm
    for more info on using ADO with various providers

    and there :
    http://msdn.microsoft.com/library/ps...k/mdap2h43.htm
    for more info on using ADO with MsJet


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