Forums

This topic is locked

No records??

Posted 13 Aug 2001 16:12:21
1
has voted
13 Aug 2001 16:12:21 Andrew Watson posted:
What is the simplest way of directing to another page if the recordset is empty
?? just now i get a horrible error message.

Replies

Replied 13 Aug 2001 16:20:04
13 Aug 2001 16:20:04 Joel Martinez replied:
to be honest with you, I think there's an extension about this, but I don't remember.

but you can add this code after the recordset (in code view) to get the desired effect .<pre id=code><font face=courier size=2 id=code>IF recordset1.eof THEN
response.redirect("fail.asp"
END IF</font id=code></pre id=code>if you get an error about headers being written, put this at the top of the page (but below the <b>language="VSCRIPT"</b> if it's there)

<b>&lt;%response.buffer=true%&gt;</b>

Joel Martinez

----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"

Edited by - joelmartinez on 08/13/2001 16:20:44
Replied 14 Aug 2001 15:02:36
14 Aug 2001 15:02:36 Andrew Watson replied:
Thanks Joel,

excuse my ignorance but where exactly do i put that line?

Ive tried it at the end of the section where the recordset is declared but still get same error (current record required).??

Reply to this topic