Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Location
    Australia
    Posts
    26

    Unanswered: counting/looping through record sets

    Hi,

    I'm getting out of range errors when i populate an array (vbscript) from a recordset. It's because i don't fully understand the finer details i suppose.


    intCount = 0
    rs.moveFirst
    Do while NOT rs.EOF
    response.write rs.EOF
    response.write intCount
    intCount = intCount + 1
    rs.moveNext
    Loop

    returns this:
    False0False1False2False3False45

    one too many!

    thanks in advance!

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    What is the error message?
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    May 2002
    Location
    Australia
    Posts
    26
    Originally posted by Satya
    What is the error message?

    There are 5 rows in the record set and it loops through 6 times. So my array has an out of range error.

    sorry not to be clear. Der!

Posting Permissions

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