Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Put vbscript run-time error description into a log file

Status
Not open for further replies.

SlakeB

MIS
Jun 15, 2005
40
US
Is there any way to automaticaly put the error description from a vbscript run-time error into a log file(either text file, or MS ACCESS table)?
 
I assume you know the basics about FileSystemObject (aka fso).
In order to trap run-time error you have to put this instruction in each function/procedure:
On Error Resume Next
Then each time the code is likely to raise an error:
If Err Then
yourLogFile.WriteLine "Error# " & Err.Number & " : " & Err.Description
Err.Clear
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top