Link to home
Start Free TrialLog in
Avatar of holdkoros
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.
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
When you work with linked TableDef objects, the RecordCount property setting is always –1.
Using the Requery method on a Recordset object resets the RecordCount property just as if the query were re-executed.
gron, that is DAO stuff you are talking about, ADO is a different beast (similar in some respects but not the same).