holdkoros
asked on
Recordset.Recordcount = -1 ??????
Hi!
I make a query into a recordset. It isn't Nothing, but when I pick it's RecordCount, it always returns with -1.
Why?
strSQL = "Select * from Table"
Set guestBookData = New ADODB.Recordset
guestBookData.Open strSQL, conn
c = guestBookData.RecordCount
MsgBox c
--------------------
c = -1, but rs isn't empty, I can get the data from it.
I make a query into a recordset. It isn't Nothing, but when I pick it's RecordCount, it always returns with -1.
Why?
strSQL = "Select * from Table"
Set guestBookData = New ADODB.Recordset
guestBookData.Open strSQL, conn
c = guestBookData.RecordCount
MsgBox c
--------------------
c = -1, but rs isn't empty, I can get the data from it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
gron, that is DAO stuff you are talking about, ADO is a different beast (similar in some respects but not the same).
Using the Requery method on a Recordset object resets the RecordCount property just as if the query were re-executed.