Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-07-2002, 02:36 PM   PM User | #1
Darksbane
New Coder

 
Join Date: Jun 2002
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Darksbane is an unknown quantity at this point
Number of rows returned with a select?

Is there a way to grab the number of rows returned in a select?

So say if I have

SQL = "Select * From someDB"
Set RS = DBconn.Execute(SQL)

is there some way to say RS.SOME_COMMAND and have it return the correct number?

I seem to recall doing this before (might have been in PHP though) but I just can't remember how.


Any help would be appreciated,

Darksbane
Darksbane is offline   Reply With Quote
Old 08-07-2002, 04:03 PM   PM User | #2
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
Yeah from your recordset object:

object.RecordCount

Now if it gives your -1 then read this:

http://www.asp101.com/samples/db_count.asp
__________________
OracleGuy
oracleguy is offline   Reply With Quote
Old 08-07-2002, 07:00 PM   PM User | #3
landon11
Regular Coder

 
Join Date: Jun 2002
Location: USA
Posts: 113
Thanks: 0
Thanked 0 Times in 0 Posts
landon11 is an unknown quantity at this point
You could also do this:

Select count(*) for someDB
__________________
USA
landon11 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:04 AM.


Advertisement
Log in to turn off these ads.