Link to home
Start Free TrialLog in
Avatar of test1234
test1234Flag for United States of America

asked on

How do I open ado recordset?

How do I open up a recordset.  I have browsed the post people have made and I saw this code.  I am taking information from a sql db and inserting it into a listbox.  

I have other issues but I am going to try to work them out before I post them on here.
Dim sSQL As String
Dim rstTemp As adodb.Recordset
 
sSQL = "SELECT myField FROM myTable"
Set rstTemp = dbconnection.execute(sSQL)
 
Do While Not rstTemp.EOF
    List1.AddItem rstTemp.fields("myField")
    rstTemp.movenext
Loop
 
rstTemp.Close

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial