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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error from Search results page

Status
Not open for further replies.

redwatty

IS-IT--Management
Aug 3, 2001
46
0
0
GB
Hi,

I have a simple asp search page in Ultradev on a site that is using VBScript. When the search result page can't find a result in the database it returns the following error

ADODB.Field error '800a0bcd'

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

What I want to be able to do is, trap this error and then redirect the user to a search error page to display a message saying there were no records to display.

If anyone has any ideas I would be most grateful.
 
add something like this:

db connection stuff

if rs.eof or rs.bof then
response.write "There is no data on your search. Please retry using different search parameters."
else

all the other code for actually doing the search

end if
hth
mb
 
If there are no results to display then BOF and EOF are both set so you would only need to compare against one of these.

Code:
If rs.EOF Then
...etc

Tony
 
Hi,

I'm new to these forums. Sorry to be thick, but what do
"hth" and "mb" mean at the end of Hithere's reply?!?
 
Cheers fella's, I have managed to get it to work. I used the initial piece of code and then did response.redirect to a seperate page, as I was having all kinds of fun trying to format the text I wanted to display in the response.write proceedure.

It works a treat, so thanks again.

Oh and I think "hth" is an abbreviation of his name not sure what "mb" stands for. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top