Eitan wrote:
Hello,
I want to emphasize a point for my prior posts :
How can I trap a message in ASP (not dotnet), to a specific label.
(I know : on error goto my_label ...
but this does not work in ASP pages)
Thanks :)
One of the links that was provided showed an example, but here's a generic
example:
on error resume next
'bunch of statements
'statement that may generate an error
if err <> 0 then
'handle the error
response.write err.number & ": " & err.description
'use Select Case to tailor your action to specific error numbers
end if
'turn off error handling if appropriate (this is optional*):
on error goto 0
In addition, with ADO, you also can ustilize the connection object's Errors
collection (you still have to us on error resume next)
on error resume next
conn.execute querythatmayproduceerror
if conn.Errors.count > 0 then
for each adoerr in conn.errors
response.write "<BR>ADO Error #" & adoerr.number & "<BR>" & _
"DB Error #: & ": " & adoerr.nativeError & "<BR>" & _
"Description: " ": " & adoerr.description
'use Select Case to tailor your action to specific error numbers
next
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"