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

error handling

Status
Not open for further replies.

cabobound

Programmer
Jul 11, 2007
80
US
I am getting an error in a loop that shouldn't be there. It is processing a lot of information and want to see the string so that I can identify the issue. The error is a duplicate key but happens after 10 minutes of processing. How do I allow the script to run but print the string when it errors out?

sTr="Insert Into table (field) Values (field)"
gConn.Execute(sTr)

Thanks for the help

Keith
 
<%
on error resume next
' do your processing
if err.number <> 0 then
response.write err.number & "<br />"
response.write err.source& "<br />"
response.write err.description & "<br />"
response.write myString
end if
%>


--------

GOOGLE is a great resource to find answers to questions like "how do i..."


--------
 
You should reset the error handling with "on error goto 0" after trapping the error, otherwise your code will ignore possible errors later...

<%
on error resume next
' do your processing
if err.number <> 0 then
response.write err.number & "<br />"
response.write err.source& "<br />"
response.write err.description & "<br />"
response.write myString
end if
on error goto 0
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top