Hello again
In one of my pages - I know customers are experiencing problems so I have this in place with the hope that I can work out what is going wrong as I cant reproduce it.
::::::::::::::::::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::
Sub TrapError(oErr)
If Not oErr.number = 0 Then
strErrorMessage = "At " & Now & " the following errors occurred on the page " & Request.ServerVariables("S
CRIPT_NAME
") & "<br>" &_
"error number: " & oErr.Number & "<br>" &_
"error source: " & oErr.source & "<br>" &_
"error description: " & oErr.description & "<br>"
Call SendMail("me@me.com", "me@me.com", "", "WEBSITE ERROR OCCURRED", strErrorMessage)
Response.Write "For security reasons, your session has expired. Please click the back button to return to the payment page and try again"
Response.End()
End If
End Sub
Sub SendMail(sTo, sFrom, sReplyTo, sSubject, sBody)
If sReplyTo = "" Then sReplyTo = sFrom
Set oMail = Server.CreateObject("CDONT
S.Newmail"
)
With oMail
.MailFormat = 0
.BodyFormat = 0
.To = sTo 'set 'To' address
.From = sFrom 'set 'From' address
.Value("Reply-To") = sReplyTo 'set 'Reply to' address
.Subject = sSubject 'set the subject line
sHTML =_
"<HTML>" &_
"<HEAD>" &_
"<TITLE>" & sSubject & "</TITLE>" &_
"</HEAD>" &_
"<BODY>" & sBody & "</BODY>" &_
"</HTML>"
.Body = sHTML 'set the message content
.Send 'and send the message
End With
Set oMail = Nothing 'then destroy the component
End Sub
::::::::::::::::::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::
/Payment.asp contains a series of SP executes.
The kind of email I get back is something like:
At 19/10/2005 11:49:30 the following errors occurred on the page /Payment.asp
error number: -2147217900
error source: Microsoft OLE DB Provider for ODBC Drivers
error description: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ','.
It's just not very meaingful - is there anything I can add to make the message more meaningful as at the moment I can see the time people experience an error but that's all?
Start Free Trial