ADODB Recordset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Has anyone encountered an error where the RecordCount property comes in as
-1, regardless of whether there are records in the RecordSet or not? If so,
how do you fix it?
 
twen said:
Has anyone encountered an error where the RecordCount property comes
in as -1, regardless of whether there are records in the RecordSet
or not? If so, how do you fix it?

The -1 means that it can't determine the actual number of records.

If you're only after testing whether there are records or not, use

if ((not rs.bof) and (not rs.eof)) then
' ah - there are records...
end if

If you really, really need a recordcount, do a select count(*) ... with
the same where clause.

You're supposed to be able to get the correct recordcount with with
some
properties, lets see if I recall, client side cursor, static or keyset
-
but I'm not sure I'd rely upon it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top