<%@ Language=VBScript %> <%Response.Buffer = True%> ASP 3.0 Error <% 'adovbs.inc, never leave home without it! %>

Internal Server Error
<% On Error Resume Next 'Referencing the error object set objError = Server.getLastError() strNumber = objError.AspCode strSource = objError.Category strPage = objError.File strDesc = objError.Description strCode = Server.HTMLEncode(objError.Source) If strCode = "" then strCode = "No code available" strLine = ObjError.Line strASPDesc = ObjError.ASPDescription 'You get the entire context of the page that had the error. 'Review the server variables to see if you would want to store more information. strRemoteAddr = Request.ServerVariables("REMOTE_ADDR") strRemoteHost = Request.ServerVariables("REMOTE_HOST") strLocalAddr = Request.ServerVariables("LOCAL_ADDR") 'Your basic ADO stuff. This is generic code. I would use a stored procedure to do this on SQL Server. set rs = Server.CreateObject("ADODB.Recordset") set Conn = Server.CreateObject("ADODB.Connection") 'SQL Server Connection, make sure you put in your information! conn.ConnectionString = "Provider=SQLOLEDB.1;User id=;Password=;Initial Catalog=;Data Source=;" conn.open rs.Open "tblErrorDemo", conn, adOpenDynamic, adLockOptimistic, adCmdTable 'Adding Record rs.AddNew 'The datetime is set on the backend as a default value. rs("er_number") = strNumber rs("er_source") = strSource rs("er_page") = strPage rs("er_desc") = strDesc + ". " + strASPDesc rs("er_code") = strCode rs("er_line") = strLine rs("er_remote_addr") = strRemoteAddr rs("er_remote_host") = strRemotehost rs("er_local_addr") = strLocalAddr rs.Update %>

Error Number:<%=strNumber%>
Source:<%=strSource%>
File:<%=strPage%>
Description:<%=strDesc + ". " + strASPDesc%>
Code:<%=strcode%>
Line:<%=strLine%>
Remote Address:<%=strRemoteAddr%>
Remote Host:<%=strRemoteHost%>


Error CodeError MessageExtended Information
ASP 0100Out of memoryUnabled to allocate the required memory.
ASP 0101Unexpected errorThe function return exception_name.
ASP 0102Expecting string inputNone
ASP 0103Expecting numeric inputNone
ASP 0104Operation not allowedNone
ASP 0105Index out of rangeAn array index is out of range.
ASP 0106Type MismatchA data type was encountered that cannot be handled.
ASP 0107Stack OverflowThe quantity of data being processed is above the permitted limit.
ASP 0115Unexpected ErrorA trapple error occured in an external object. The script cannot continue running.
ASP 0177Server.CreateObject FailedInvalid ProgId
ASP 0190Unexpected errorA trapple error occurred while releasing an external object.
ASP 0191Unexpected errorA trapple error occurred in the OnStartPage method of an external object.
ASP 0192Unexpected errorA trapple error occurred in the OnEndPage method of an external object.
ASP 0193OnStartPage FailedAn error occurred in the OnStartPage method of an external object.
ASP 0194OnEndPageAn error occurred in the OnEndPage method of an external object.
ASP 0240Script Engine ExceptionA script engine threw exception.
ASP 0241CreateObject ExceptionThe CreateObject caused an exception.
ASP 0242Query OnStartPage Interface ExceptionThe querying object OnStartPage caused an exception.