myArray = recordset.getrows

Discussion in 'ASP General' started by dotnettester, Mar 1, 2006.

  1. dotnettester

    dotnettester Guest

    Hi,

    would this code give an EOF or BOF error if there are no rows in the
    recordset? or the array myArray would be just null?

    Thnx.
     
    dotnettester, Mar 1, 2006
    #1
    1. Advertisements

  2. dotnettester wrote:
    > Hi,
    >
    > would this code give an EOF or BOF error if there are no rows in the
    > recordset?

    Yes. That is why I always do this:

    dim myArray
    recordset.open ...
    if not recordset.eof then myArray = recordset.getrows
    recordset.close:set recordset=nothing
    connection.close: set connection=nothing

    if isarray(myArray) then
    'process it
    else
    'report that there were no records
    end if

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Mar 1, 2006
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike B
    Replies:
    2
    Views:
    372
    Rapscallion
    Jun 8, 2005
  2. Duim
    Replies:
    2
    Views:
    408
  3. Hung Huynh
    Replies:
    8
    Views:
    631
    Bob Barrows
    Sep 24, 2003
  4. Guest

    redim preserve myArray(i)

    Guest, Jan 17, 2004, in forum: ASP General
    Replies:
    2
    Views:
    302
    Guest
    Jan 17, 2004
  5. John MacIntyre
    Replies:
    4
    Views:
    189
    John MacIntyre
    Sep 24, 2003
  6. Fabian
    Replies:
    13
    Views:
    330
    Lasse Reichstein Nielsen
    Nov 18, 2003
  7. Dag Sunde

    MyArray.length returns undefined...

    Dag Sunde, Mar 2, 2004, in forum: Javascript
    Replies:
    3
    Views:
    150
    Michael Winter
    Mar 2, 2004
  8. Andrew Phillipo
    Replies:
    3
    Views:
    189
    Martin Honnen
    Sep 22, 2005
Loading...