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

How to write error handling code?

Status
Not open for further replies.

longmatch

Programmer
Nov 1, 2001
406
Dear All:
I have finished writing my ASP coding. In my program I used connection, recordset to access backend database, used CDONTS to send email. There is no error handling in my coding. Anybody can show me how to do it?


Haijun
 
What you need to do is to add

Code:
on error resunme next

at the top of your page. After every line that might cause an error that you want to catch - such as server.createobject etc, then you check to see if an error has occured using the err.number value and then handle that code inside an if statement.

James :) James Culshaw
jculshaw@miniaturereview.co.uk
 
What you need to do is to add

Code:
on error resume next

at the top of your page. After every line that might cause an error that you want to catch - such as server.createobject etc, then you check to see if an error has occured using the err.number value and then handle that code inside an if statement.

James :) James Culshaw
jculshaw@miniaturereview.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top