recordcount -1

M

middletree

I'm simply trying to get a number of records returned in a recordset, and
just get a -1. I have looke din a few books and other references, can't
seem to find any answers. Anyone have any idea why I can't get a real
number? For the record, the recordset is not empty. In fact, it has many
records which I can see plainly on the screen. But when I do response.write
rs.recordcount, it just shows -1
 
T

Tom Kaminski [MVP]

middletree said:
I'm simply trying to get a number of records returned in a recordset, and
just get a -1. I have looke din a few books and other references, can't
seem to find any answers. Anyone have any idea why I can't get a real
number? For the record, the recordset is not empty. In fact, it has many
records which I can see plainly on the screen. But when I do response.write
rs.recordcount, it just shows -1

http://www.aspfaq.com/show.asp?id=2193
 
K

Ken Schaefer

Alternatively, look at using .GetRows() if you also need the data, rather
than executing two queries.

..getRows places your Recordset data into a VBScript array. Then you can use
the UBound() function to work out how many records there are.

Cheers
Ken

: That did it; thanks
:
:
: "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
: : > http://www.aspfaq.com/2193
: >
: > Ray at work
: >
: > : > > I'm simply trying to get a number of records returned in a recordset,
: and
: > > just get a -1. I have looke din a few books and other references,
can't
: > > seem to find any answers. Anyone have any idea why I can't get a real
: > > number? For the record, the recordset is not empty. In fact, it has
: many
: > > records which I can see plainly on the screen. But when I do
: > response.write
: > > rs.recordcount, it just shows -1
: > >
: > >
: >
: >
:
:
 
C

Chris Barber

That's a nice FAQ Ray.

Some day I must try and see if you have a searchable index [XML hopefully] I
can periodically [read 'automagically'] get hold of and put on my intranet /
website.

Chris.


"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
http://www.aspfaq.com/2193

Ray at work
 
C

Chris Barber

Since you're always posting the FAQ ref's, I thought it was your site!
I had a vision of you knowing every FAQ number off by heart and just quoting
them ad hoc in the relevant posts.

LoL.

Chris.

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
It's not my site!!! http://www.aspfaq.com/credits.asp But you're right.
It's an outstanding FAQ site...

Ray at work
 
R

Ray at

Heh. I think I accuse Aaron of the same thing before. No, I link that that
site all the time because I think 95% of what I know came from there. Don't
forget to click the paypal link. :]

Ray at work

Chris Barber said:
Since you're always posting the FAQ ref's, I thought it was your site!
I had a vision of you knowing every FAQ number off by heart and just quoting
them ad hoc in the relevant posts.

LoL.

Chris.

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
It's not my site!!! http://www.aspfaq.com/credits.asp But you're right.
It's an outstanding FAQ site...

Ray at work

Chris Barber said:
That's a nice FAQ Ray.

Some day I must try and see if you have a searchable index [XML
hopefully]
I
can periodically [read 'automagically'] get hold of and put on my
intranet
/
website.

Chris.
 

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

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top