PDA

Click to See Complete Forum and Search --> : Anyone Using ADO?


DVint
Aug 30th, 1999, 05:54 AM
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?

Serge
Aug 30th, 1999, 03:51 PM
Try this:


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
Serge_Dymkov@vertexinc.com
Access8484@aol.com

Aug 30th, 1999, 06:45 PM
I can use this...

Very nice

thankyou, Marc