Results 1 to 3 of 3

Thread: Anyone Using ADO?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Seattle WA USA
    Posts
    21

    Post

    I don't think I'm stupid, but I can't seem to get anything to work with ADO yet. Plus, I don't know what or who to believe when it comes to documentation. Can somebody just tell me how to open a simple recordset on a simple Access table in the same folder as the app?

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Try this:

    Code:
        Dim cn As New ADODB.Connection
        Dim rs As New ADODB.Recordset
        Dim strSQL As String
        
        cn.Provider = "Microsoft.Jet.OLEDB.3.51"
        cn.Open "D:\Microsoft Visual Studio\VB98\Nwind.mdb", "admin", ""
        strSQL = "Select * From Customers"
        rs.Open strSQL, cn, adOpenStatic
        
        If rs.EOF And rs.BOF Then Exit Sub
        
        Do Until rs.EOF
            List1.AddItem rs(1)
            rs.MoveNext
        Loop
        
        rs.Close
        Set rs = Nothing
        cn.Close
        Set cn = Nothing
    Regards,

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]



  3. #3
    Guest

    Post

    I can use this...

    Very nice

    thankyou, Marc

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