June 1999
Intermediate to advanced
1368 pages
29h 45m
English
Now it's time to see how to use ADO to perform one of the most common tasks—opening recordsets.
To open a recordset, you will first create a connection object off the current project, and then specify a new ADO recordset object:
Sub OpenRecordsetWithGetStringDisplayExample()
Dim cnnLocal As New ADODB.Connection
Dim rstCurr As New ADODB.Recordset
Set cnnLocal = CurrentProject.Connection
rstCurr.Open "Select * from tblMovieTitles where ReleaseDate _
= #02/01/99#", cnnLocal, _
adOpenStatic, adOpenPessimistic
Debug.Print rstCurr.GetString
rstCurr.Close
End Sub
Although this code is very similar to DAO, in ADO you use the Recordset object's Open method rather than an OpenRecordset method. ...
Read now
Unlock full access