Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | ASP | Q5817 [ previous next ]

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?'

©2018 Martin Webb