How to log ASP-error codes?

M

Michael Bender

Hi everybody,

I would like to write ASP error codes in a log file. Error message would be
for example:

ADODB.Fields error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name
or ordinal.
/ASP-application/page1.asp, line 67

I've learned that it is possible to get some information with the
'err-object' of VB. Unfortunately these codes and descriptions are not that
good as the ones ASP itself generates. First of all I'm interested in the
description ("Item cannot be found in..") and the line in the ASP-Page where
the error occurs.

Does anybody know how to catch this information?

Thx and best regards
Michael
 
P

Phill. W

Michael Bender said:
I would like to write ASP error codes in a log file. .. . .
I've learned that it is possible to get some information with the
'err-object' of VB. Unfortunately these codes and descriptions are not
that good as the ones ASP itself generates.

In what way?
ADODB.Fields error '800a0cc1'
Item cannot be found in the collection corresponding to the
requested name or ordinal.
/ASP-application/page1.asp, line 67

If you trap this error,
Err.Number = 0x800a0cc1,
Err.Description = "Item cannot be found ..."

What you /won't/ get is the executing page and line number.
The first you can retrieve from

Request.ServerVaraibles( "Script_Name" )

the latter you can't easily get hold of without doctoring your code
with physical line numbers. Personally, I prefer to record the name
of the failing /function/ rather than just an arbitrary line number.

HTH,
Phill W.
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top