0

Hi Guys.

Is it possible to trap this error in Classic ASP, and redirect to another page instead of displaying this error?


Microsoft OLE DB Provider for SQL Server error '80004005'

Transaction (Process ID 104) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

It happens when a lot of people accessing my intranet site all at the same time.

Thanks in advance!

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by Golden-Boy
0

Yes it is possible. On the top of the main ASP page, put <% On Error Resume Next %> At the end of your page, put an email system if you want, where in body part of the mail, you make it response the error and send you

Example sending the email using CDO.Message:

<%
If Err.Number <> 0 Then

[INDENT] [B]
'CREATE THE MAIL OBJECT[/B] 
Set objMail = Server.CreateObject("CDO.Message")
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = application("SMTP")
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
			
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername")= [B]SMTP USERNAME[/B]
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword")= [B]SMTP PASSWORD[/B]
									
objMail.Configuration.Fields.Update
objMail.MimeFormatted=false


'[B]SET KEY PROPERTIES[/B]
objMail.From = "[B]MYSELF@MYDOMAIN.COM[/B]"
objMail.To = "[B]SENDER@SENDERDOMAIN.COM[/B]"
objMail.Subject= "ASP ERROR"
objMail.HtmlBody = "Description = " & Err.Description & "<br>Error Number:" & Err.Number & "<br>"Error Line : " & Err.Line

'SEND THE EMAIL
objMail.Send

'CLEAN-UP MAIL OBJECT
Set objMail = Nothing
[/INDENT]

'---- [B]REDIRECT USER TO ANOTHER PAGE[/B] -----

Response.Redirect("secondarypage.asp")

End If

On Error GoTo 0
%>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.