Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q5817 Why does RecordSet.RecordCount give me -1 as a return value?

irt.org | Knowledge Base | ASP | Q5817 [ previous next ]

Q5817 Why does RecordSet.RecordCount give me -1 as a return value?

The RecordCount property is a read-only property available only to recordsets opened with one of two kinds of cursortypes.

Will return actual RecordCount: adOpenKeyset adOpenStatic

Will return -1: adOpenForwardOnly (the default value) adOpenDynamic

<%
' THIS CODE SHOWS THE ACTUAL RecordCount
RS.Open SQL, Connection, adOpenStatic, adLockReadOnly
response.write RS.RecordCount
%>

<%
' THIS CODE SHOWS -1
RS.Open SQL, Connection, adOpenForwardOnly, adLockReadOnly
response.write RS.RecordCount
%>

Feedback on 'Q5817 Why does RecordSet.RecordCount give me -1 as a return value?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.