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. Advertising

  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. Advertising

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:
    295
    Rapscallion
    Jun 8, 2005
  2. Duim
    Replies:
    2
    Views:
    305
  3. Guest

    redim preserve myArray(i)

    Guest, Jan 17, 2004, in forum: ASP General
    Replies:
    2
    Views:
    136
    Guest
    Jan 17, 2004
  4. John MacIntyre
    Replies:
    4
    Views:
    115
    John MacIntyre
    Sep 24, 2003
  5. Fabian
    Replies:
    13
    Views:
    235
    Lasse Reichstein Nielsen
    Nov 18, 2003
Loading...

Share This Page