web 2.0

ASP & Error Object

ASP & Error Object function get a returns the previous exception.

ShotDev Focus:

- The previous exception that was thrown.

Example

asp_getlasterror.asp


<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim objErr
Set objErr = Server.GetLastError()
Response.Write("<br>Error Code = " & objErr.ASPCode)
Response.Write("<br>Error Description = " &  objErr.ASPDescription)
Response.Write("<br>Category = " & objErr.Category)
Response.Write("<br>Column = " & objErr.Column)
Response.Write("<br>Description = " & objErr.Description)
Response.Write("<br>File = " & objErr.File)
Response.Write("<br>Line = " & objErr.Line)
Response.Write("<br>Number = " & objErr.Number)
Response.Write("<br>Source = " & objErr.Source)
%>
</body>
</html>

Create a asp file and save to path root-path/myasp/

Run

http://localhost/myasp/asp_getlasterror.asp

.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 10.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.