Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    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

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could also do this:

    Select count(*) for someDB
    USA


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •