ASP - ASP Error Handling - Asked By Adhik Kadam on 27-Jun-01 02:22 AM

How can i handle errors occured at runtime. I want to send a mail to administrator containg error details and want to redirect user to some specific page.

Well... - Asked By Robbe Morris on 27-Jun-01 08:23 AM

You can either use the common 

  on error resume next

   ' some ASP code here

  if err.number <> 0 then
    ' perform your email
  end if

 Or, you may also need to trap the errors with ADO
 using the ADOCon.Errors collection.  Here's a sample

 <%

  function DBError(oADOCon)
  
      dim oADOErr
    
      If oADOCon.Errors.Count > 0 Then
        For Each oADOErr In oADOCon.Errors
           response.write oADOErr.Description & "<br>"
        Next
      End If

  end function

  %>

Thank a lot.... It works.... - Asked By Adhik Kadam on 19-Jul-14 05:10 AM

I tried what u told...and it works

I need some more help - Asked By Adhik Kadam on 19-Jul-14 05:11 AM

 I have done some part of error handling but still one problem ramains. I m using Err Object of ASP 3.0 to find out weather error occured or not but i m not able to pass that trapped values of error like Err.ErrorNumber, Err.ErrorDescription on Second page where i redirecting user and from there i m sending mail to administrator with details of error occured.
Is the scope of that Err Object is for the page only or is there any other way from where i can get the last error details