local recordset in acess

  • Thread starter Thread starter kimi
  • Start date Start date
K

kimi

i need to create a recordset by looping through the contents of a local
access table.
how do I go about this?

do I connect to the local table via ado or odbc to create the recordset
or is there anoy method when working with local tables in the current
access db?

thank you in advance
 
I figured it out...


Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "[agent]", CurrentProject.Connection, adOpenKeyset,
adLockOptimistic

If Not rs.EOF Then
Do While Not rs.EOF
MsgBox (rs.Fields("agent").Value)
rs.MoveNext
Loop
End If
 
In my experience DAO outperforms ADO within an Access project.

Dim db ' as DAO.Database
Dim rs ' as DAO.Recordset

Set db = currentdb
Set rs = db.openrecordset("agent")

with rs
do until .eof
msgbox .fields("agent")
.movenext
loop
end with
 
Back
Top