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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Err (ERROR) functionality in VBscript?

Status
Not open for further replies.

Rock6431

Programmer
Mar 23, 2002
56
US

I need to detect whether or not an error occurs when attempting to create a new object via VB Script. I have tried on error goto X as well as if err <> 0 then... What format is used in VBScript to detect an Error? Or is there a way since it is scripting and not actually VB.

Mike
 
In ASP VBScript, I put

ON ERROR RESUME NEXT

at the top of my page, then when I want to check for an error, I use:

If Err <> 0 then
...
end if

The On Error statement is important, otherwise the script breaks as soon as it encounters the error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top