Connecting Tech Pros Worldwide Help | Site Map

On error

polilop
Guest
 
Posts: n/a
#1: Jul 22 '05
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?


Bob Barrows [MVP]
Guest
 
Posts: n/a
#2: Jul 22 '05

re: On error


polilop wrote:[color=blue]
> 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?[/color]

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"


polilop
Guest
 
Posts: n/a
#3: Jul 22 '05

re: On error


thanks
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:%232oPPADUFHA.3544@TK2MSFTNGP10.phx.gbl...[color=blue]
> polilop wrote:[color=green]
>> 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?[/color]
>
> 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"
>[/color]


Closed Thread


Similar ASP / Active Server Pages bytes