BOF / EOF error handling

Results 1 to 2 of 2

Thread: BOF / EOF error handling

  1. #1
    Jakernaut Guest

    Default BOF / EOF error handling

    I am accessing a table by date, and if a row exists with that date, I want to return value a. If the date does not exist, I want to just display a space. I am currently using a WHILE NOT RS.EOF approach, but I get the BOF/EOF error if the date does not exist. How can I code this correctly?<BR><BR>Thanks.

  2. #2
    Eddie Campbell Guest

    Default RE: BOF / EOF error handling

    This should work<BR><BR>"Select * from Mytable where MyDate =#" & TestDate & "#"<BR>Set MyRs=ObjConn.Execute(Cmd)<BR><BR>If MyRs.Eof then<BR> Displayval = "&amp;nbsp;"<BR>else<BR> DisplayVal = MyRs("MyDate")<BR>End If<BR>Response.write DisplayVal

Posting Permissions

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