Article ID: 141171
Article Last Modified on 11/7/2003
'The following code loops through all the records in a resultset
While Not rdoToMove.EOF
'do any processing here
rdoToMove.MoveNext
Wend
To determine the number of records in a resultset, code a loop like the one
above and increment a count variable inside the loop.
Private Sub Command1_Click()
Dim ps As rdoPreparedStatement
Dim conn As rdoConnection
Dim strDSN As String
Dim strConnect As String
Dim strSQL As String
strDSN = "pubs"
strConnect = "Username=<username>;PWD=<strong password>;database=pubs"
strSQL = "Select * From Authors"
With rdoEnvironments(0)
.CursorDriver = rdUseOdbc
Set conn = .OpenConnection _
(strDSN, rdDriverNoPrompt, False, strConnect)
End With
Set ps = conn.CreatePreparedStatement("", strSQL)
Set rs = ps.OpenResultset(rdOpenForwardOnly)
rs.MoveLast 'this line causes the error
End Sub
Additional query words: 4.00 vb4win vb432
Keywords: kbenv kbdatabase kbprb KB141171