Empty RecordSet causing problems

Results 1 to 2 of 2

Thread: Empty RecordSet causing problems

  1. #1
    Join Date
    Dec 1969

    Default Empty RecordSet causing problems

    I am trying to populate an array using getrows and it works fine when there is data in the table. But when the returning recordset is empty I get the "BOF or EOF is true" error. I need to put some code in that will bypass the getrows if the recordset is empty and populate the first index of the array with the string "No Options". <BR>I know this should be simple but its my first time doing this.Thanks for the help if anyone can.<BR><BR>Recordset2.CursorType = 0<BR>Recordset2.CursorLocation = 2<BR>Recordset2.LockType = 3<BR>Recordset2.Open()<BR>Code that does this ???if recordset2.EOF is TRUE then<BR> ???arrOptions(1) = "No Options"<BR> ???Else<BR> ???arrOptions = Recordset2.getrows<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Empty RecordSet causing problems

    try this:<BR>&#039; -- Populate our Recordset with data<BR>set objRS=objconn.execute(strSQL)<BR><BR>If objRS.eof then<BR> response.write "No Options"<BR>response.end<BR>End if<BR><BR>Dim tablevalue<BR><BR>tablevalue=objRS.getrows<BR><BR> <BR>Regards<BR>Paul M

Posting Permissions

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