Forums
This topic is locked
onError / Error Handling
Posted 26 Sep 2002 09:41:02
1
has voted
26 Sep 2002 09:41:02 Gary Whittle posted:
Hello.I am wondering if there is a way to return a different message on the below error?
"ADODB.Recordset.1 error '80020009'
Either BOF or EOF is True, or the current record has been deleted; the operation requested by the application requires a current record.
/management_system/private_restricted/reports/results.asp, line 120"
We all know what it means, but in the real world, people browsing your site will sit and look confused, and probably come to the conclusion that the site is "down".
I would love to have a page which simply says "Sorry - no results to display, click here to search again".
Is it onError or does that just work for JavaScript?
Thanks for any help offered.
Gary.
Replies
Replied 26 Sep 2002 10:22:20
26 Sep 2002 10:22:20 Stuart Harland replied:
You could simply use something like:
'you've opened your recordset above this called 'rs'...
< body >
< %
If Not rs.EOF Or Not rs.BOF Then
% >
'Here do all the HTML or ASP script you'd normally do to present the records
< %
Else
% >
'Do handling for no records (EOF or BOF)
'Eg. Sorry - no results to display, click here to search again
< %
End If
% >
< / body >
********************
wheatNOTmeat
'you've opened your recordset above this called 'rs'...
< body >
< %
If Not rs.EOF Or Not rs.BOF Then
% >
'Here do all the HTML or ASP script you'd normally do to present the records
< %
Else
% >
'Do handling for no records (EOF or BOF)
'Eg. Sorry - no results to display, click here to search again
< %
End If
% >
< / body >
********************
wheatNOTmeat