Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

ASP ASPError Object Properties

  • Last Updated : 31 Mar, 2021
  • ASP Code: The ASPCode is used for returning the string value which determines the error code that would be generated by the IIS server. This Property applies to Error Object. It is an inbuilt method of the Error object.

    Syntax:

    ASPError.ASPCode()
  • ASPDescription: The ASPDescription is used to return a detailed description of an error.

    Syntax:

    ASPError.ASPDescription()
  • ASP Category: The ASP Category Property is used to return the source of an error.

    Syntax:

    ASPError.Category()
  • Column: The ASP Column property is used to the column position within the ASP file that generated the error.

    Syntax:

    ASPError.Column()
  • Description: The ASP Description property is used to return a small description of an error.

    Syntax:



    ASPError.Description()
  • File: The ASP File property is used to return the name of the ASP File which generates an error. 

    Syntax:

    ASPError.File()
  • Line: The ASP Line Property is used to return a line number in the ASP file which generates an error.

    Syntax:

    ASPError.Line()
  • Number: The ASP Number Property is used to return the standard COM error code for the error.

    Syntax:

    ASPError.Number()
  • Source: The ASP Source Property is used to return the actual source code of the line where the error occurred.

    Syntax:

    ASPError.Source() 

Example Code: Below code covers all the properties of an Error Object. 

ASP




<%
dim objErr
set objErr=Server.GetLastError()
  
response.write("ASPCode=" & objErr.ASPCode)
response.write("<br>")
response.write("ASPDescription=" & objErr.ASPDescription)
response.write("<br>")
response.write("Category=" & objErr.Category)
response.write("<br>")
response.write("Column=" & objErr.Column)
response.write("<br>")
response.write("Description=" & objErr.Description)
response.write("<br>")
response.write("File=" & objErr.File)
response.write("<br>")
response.write("Line=" & objErr.Line)
response.write("<br>")
response.write("Number=" & objErr.Number)
response.write("<br>")
response.write("Source=" & objErr.Source)
%>

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :