Features
Ask DevGuru
ASP Resources
Find the Bug
Knowledge Base
Links
Tips of the Week
Tutorials
Products
dgCalendar
dgCharge New!
dgChart New!
dgFileUpload
dgReport New!
dgSort
dgTree
Site
Authoring
Coming Soon
DevGuru Resume
Link to Us
Merchandise
Sponsorships
Testimonials
What's New
Technologies
ADO 2.6
ASP
CSS2
HTML
JavaScript
Jet SQL
Transact-SQL Syntax
VBScript
WML
WMLScript
WSH
XML DOM
All Statements
Error Object
Exit Statement
STATEMENT: On Error
Implemented in version 1.0
On Error Resume Next
On Error GoTo 0
The
On Error Resume Next
statement gives you a limited amount of error handling control by preventing program interruptions from runtime errors. When an error occurs, by using this statement, the line of code containing the error is simply skipped over and the program continues running.
Note that the error is not corrected, just ignored, and an error message is not displayed. Of course, your program may still crash or give erroneous output if the error involves a value required to successfully execute later portions of your code.
Code:
<% On Error Resume Next %>
The
On Error GoTo 0
statement is used to disable error handling.
Code:
<% On Error GoTo 0 %>
If you wish to know whether an error has occurred and of what type, you can insert the following code.
Code:
<% If Err.Number <> 0 Then %>
<% =Err.Number%>
<% Err.Clear %>
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information