On Error Statement
Enables or disables error handling within a procedure. If you
don’t use an
statement in your procedure, or if you have explicitly switched off
error handling, the VBScript runtime engine handles the error
automatically. First, it displays a dialog containing the standard
text of the error message, something many users are likely to find
incomprehensible. Second, it terminates the application, so any error
that occurs in the procedure produces a fatal runtime error.
When a runtime error occurs in the routine in which the
Next statement occurs,
program execution continues with the program line following the line
that generated the error. This means that, if you want to handle an
error, this line following the line that generated the error should
call or include an inline error handling routine.
When a runtime error occurs in any routine called by the routine in
On Error Resume Next statement occurs or
its subroutines, program execution returns to the statement
immediately after the subroutine call in the routine containing the
On Error Resume Next statement.
When used in an ASP page for IIS 5.0,
Next disables ASP’s own error handling.
If you have no error handling in your procedure, the VBScript runtime engine traces back through the call stack until a procedure is reached where error handling is enabled. In that case, the error ...