|
 |
asp_web_howto thread: recordset.recordcount
Message #1 by "Mike Scott" <jstmehr4u3@h...> on Wed, 21 Nov 2001 11:43:11 -0800
|
|
When I try to use the RecordCount method of an ADO recordset, I seem to
always get -1. What am I missing?
TIA,
Mike S
Message #2 by Imar Spaanjaars <Imar@S...> on Wed, 21 Nov 2001 22:00:26 +0100
|
|
Hi Mike,
Check out the following faq:
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=139
HtH
Imar
At 11:43 AM 11/21/2001 -0800, you wrote:
>When I try to use the RecordCount method of an ADO recordset, I seem to
>always get -1. What am I missing?
>
>TIA,
>Mike S
Message #3 by "Ken Schaefer" <ken@a...> on Thu, 22 Nov 2001 22:42:02 +1100
|
|
www.adopenstatic.com/faq/recordcounterror.asp
(why it's not working)
www.adopenstatic.com/faq/recordcountalternatives.asp
(better ways to do the same thing)
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Mike Scott" <jstmehr4u3@h...>
Subject: [asp_web_howto] recordset.recordcount
: When I try to use the RecordCount method of an ADO recordset, I seem to
: always get -1. What am I missing?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #4 by "Enzo Zaragoza" <enzaux@g...> on Fri, 23 Nov 2001 23:25:02 +0800
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_000D_01C17476.1363E000
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
when you get -1 it means your recordset doesn't contain any records :)
Enzo
----- Original Message -----
From: Mike Scott
To: ASP Web HowTo
Sent: Thursday, November 22, 2001 3:43 AM
Subject: [asp_web_howto] recordset.recordcount
When I try to use the RecordCount method of an ADO recordset, I seem
to
always get -1. What am I missing?
TIA,
Mike S
$subst('Email.Unsub')
Message #5 by "Ken Schaefer" <ken@a...> on Mon, 26 Nov 2001 13:20:47 +1100
|
|
Or it means that ADO doesn't know how many records there are in the
recordset.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Enzo Zaragoza" <enzaux@g...>
Subject: [asp_web_howto] Re: recordset.recordcount
when you get -1 it means your recordset doesn't contain any records :)
Enzo
----- Original Message -----
From: Mike Scott
To: ASP Web HowTo
Sent: Thursday, November 22, 2001 3:43 AM
Subject: [asp_web_howto] recordset.recordcount
When I try to use the RecordCount method of an ADO recordset, I seem to
always get -1. What am I missing?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #6 by "Robert Turner" <rturner003@b...> on Mon, 26 Nov 2001 06:10:10 -0000
|
|
For the recordsetcount to work you need to set the cursor in you
connection to be client side. For example:
conn.CursorLocation=adUseClient;
Robert T Turner
-----Original Message-----
From: Ken Schaefer [mailto:ken@a...]
Sent: 26 November 2001 02:21
To: ASP Web HowTo
Subject: [asp_web_howto] Re: recordset.recordcount
Or it means that ADO doesn't know how many records there are in the
recordset.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Enzo Zaragoza" <enzaux@g...>
Subject: [asp_web_howto] Re: recordset.recordcount
when you get -1 it means your recordset doesn't contain any records :)
Enzo
----- Original Message -----
From: Mike Scott
To: ASP Web HowTo
Sent: Thursday, November 22, 2001 3:43 AM
Subject: [asp_web_howto] recordset.recordcount
When I try to use the RecordCount method of an ADO recordset, I seem
to
always get -1. What am I missing?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rturner003@b...
$subst('Email.Unsub')
Message #7 by "Ken Schaefer" <ken@a...> on Mon, 26 Nov 2001 17:57:12 +1100
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Robert Turner" <rturner003@b...>
Subject: [asp_web_howto] Re: recordset.recordcount
: For the recordsetcount to work you need to set the cursor in you
: connection to be client side. For example:
: conn.CursorLocation=adUseClient;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Not necessarily.
I posted:
www.adopenstatic.com/faq/recordcounterror.asp
before.
adUseClient changes the *cursor type*, which is the key to solving the
problem. Once you understand this, you can use adUseServer with the correct
cursor type, and still get a .RecordCount.
None the less:
www.adopenstatic.com/faq/recordcountalternatives.asp
has better alternatives to .RecordCount
Cheers
Ken
|
|
 |