G
George
Hi, Why RecordCount always return -1? How to set the recordset to return
correct recordcount?
(working enviroment: Access 2002 on XP home box)
Following is the code for your referenc:
Dim cnn As Connection
Dim rsStudent As ADODB.Recordset
Dim strStudentSQL As String
Set cnn = CurrentProject.Connection
Set rsStudent = New ADODB.Recordset
strStudentSQL = "Select * from students"
rsStudent.ActiveConnection = cnn
rsStudent.Open strSQL, , adOpenDynamic, adLockOptimisticL
MsgBox rsStudent.RecordCount
correct recordcount?
(working enviroment: Access 2002 on XP home box)
Following is the code for your referenc:
Dim cnn As Connection
Dim rsStudent As ADODB.Recordset
Dim strStudentSQL As String
Set cnn = CurrentProject.Connection
Set rsStudent = New ADODB.Recordset
strStudentSQL = "Select * from students"
rsStudent.ActiveConnection = cnn
rsStudent.Open strSQL, , adOpenDynamic, adLockOptimisticL
MsgBox rsStudent.RecordCount