Forums

ASP

This topic is locked

800a0bcd: require a current record error

Posted 06 Jul 2001 00:37:31
1
has voted
06 Jul 2001 00:37:31 Dylan Marks posted:
Hi all.
I've been getting an error that I can't figure out and thought I would see if anyone else has any experience with the same thing here. I'm building a search results page, and everything works fine, as long as I enter a URL parameter that I know will show a result. But when I type something random in order to see what happens when the database returns an empty recordset, I get an error that says:

"ADODB.Recordset error '800a0bcd'

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

I have both a 'show region if rs is empty' and 'show region if rs is not empty' set up.

I know, it is pretty much impossible for anyone to help me with this unless they see the code etc. The only entry in Microsofts 'Knowledge Base' about this error doesn't apply. Would anyone have had an experience of this sort they could share with me? The site uses the file system object to insert images. Would this cause it?


Can I write some sort of error response code to stop this error from showing up, so it will be left blank?


Many many thanks,
Dylan.

Replies

Replied 06 Jul 2001 19:06:14
06 Jul 2001 19:06:14 Joel Martinez replied:
the error is being cause because the page is trying to access a column, or recordset parameter when it's an empty recordset...
any code that deals with a recordset should always be either in a <b>do while</b> loop, or an <b>if then</b> statement:

<font face='Georgia'>
if not rs.eof then
'--use the recordset
end if

or

do while not rs.eof
'--use the recordset
loop
</font id='Georgia'>

both of these constructs will ensure that the code block will be skipped if the recordset is empty.

if you're still having problems, you may want to post some of that code (with the error line in bold or something)

hope it helps,
Joel Martinez

----------
Is this thing on?....
Replied 06 Jul 2001 22:30:16
06 Jul 2001 22:30:16 Dylan Marks replied:
It worked! Thanks so much.

It took more than one conditional, but it was a matter of fixing one, and then trying it and going to the next line number that was producing an error and enclosing that one. I thought the show region behaviour would have been enough since it encloses everything in the rs.eof statement, but I had forgotten about other places on the page that the recordset was called.

There was one place where I had to use:

&lt;%if not rsBooksQuery.eof OR not rsBooksQuery.bof then%&gt;

(This was for setting up the cursor type for scrolling through the records.)

What helped me with this error was an extension I just found:
GoToLineNumber.mxp

It allowed me to jump to where the error was with only a right click.
I can't remember where I found it, but it is probably at Macromedia.

Thanks again Joel!

Replied 08 Jul 2001 20:33:08
08 Jul 2001 20:33:08 Waldo Smeets replied:
Probably you found it at www.UDzone.com/go?329 <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>

Waldo Smeets - www.UDzone.com Webmaster
------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
------------------------------------------

Reply to this topic