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
%>