ADO:
Dim cn as new ADODB.Connection, rs as new ADODB.RecordSet
Dim sql as String
set cn = CurrentProject.Connection
sql = "my dynamic sql string"
rs.Open sql, cn ', Other options for the type of recordset to open, adoOpenStatic, etc.
While Not rs.EOF
'do things with recordset
rs.MoveNext ' Can't tell you how many times I have forgotten the MoveNext. silly.
Wend
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
DAO ADO . DAO ADO. , , . , . ADO .
source
share