Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A page to display on the error....

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
I have a problem. When I execute the SQL and it does not return any values, I get an error saying:

ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/pclanplanning/PO_Test2.asp, line 41


Could I do something to display a user friendly message that there are no records matching the criteria.

Please suggest anything.

Thanks.
 
if (rs.bof and rs.eof) then
response.write "There is an error. Please try again"

you could add all sorts of neat javascript code to take the user back to the previous page after a predetermined time or show a javascript alert box to take them back by having them click the okay button
Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
How could I redirect a user to the previous page or to any page?
 


If (rs.bof and rs.eof) then
Response.Redirect "anotherPage.asp"
Else
do while not rs.eof

'show records

rs.movenext
loop
End If www.vzio.com
ASP WEB DEVELOPMENT



 
here is a javascript backward move

Response.Write &quot;<script language='javascript'>&quot;
Response.Write &quot;function error(){&quot;
Response.Write &quot;if (err.errcount.value>0){&quot;
Response.Write &quot;alert ('There is a problem with the form.');&quot;
Response.Write &quot;history.go(-1);&quot;
Response.Write &quot;}}&quot;
Response.Write &quot;</script>&quot;

<body bgcolor=&quot;#FEECCB&quot; text=&quot;#000000&quot; onLoad=&quot;error();&quot;>
<form name=&quot;err&quot;><input type=&quot;hidden&quot; value=&quot;1&quot; name=&quot;errcount&quot;></form> Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top