Public Sub RecordsetNavigation()
Const SQL As String = "SELECT * FROM Customers"
Const ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" + _
"Data Source=C:\mydb.mdb;Persist Security Info=False"
Dim Recordset As Recordset
Set Recordset = New Recordset
Call Recordset.Open(SQL, ConnectionString, adOpenDynamic)
Recordset.MoveLast
While Not Recordset.BOF
Debug.Print Recordset.Fields("CompanyName")
Recordset.MovePrevious
Wend
End Sub
|