On error

P

polilop

I have a page that opens a recordset (gets id from previus) but there may
not be values in the table
for the given id, so i get the BOF EOF errors. How can i handle the error so
it can
redirect to previus? All that i found is on error resume next is there
someway to
say on error go to a function?
 
B

Bob Barrows [MVP]

polilop said:
I have a page that opens a recordset (gets id from previus) but there
may not be values in the table
for the given id, so i get the BOF EOF errors. How can i handle the
error so it can
redirect to previus? All that i found is on error resume next is there
someway to
say on error go to a function?

No,

Best practice is to check if EOF is true immediately after opening the
recordset. There is never any reason to raise a BOF/EOF error.

'open the rs, then:

if not rs.EOF then
'process the rs
else
'handle the empty-recordset situation
end if

Bob Barrows
 
P

polilop

thanks
Bob Barrows said:
No,

Best practice is to check if EOF is true immediately after opening the
recordset. There is never any reason to raise a BOF/EOF error.

'open the rs, then:

if not rs.EOF then
'process the rs
else
'handle the empty-recordset situation
end if

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top