Name
ASPCode —
objASPError.ASPCode
Synopsis
The ASPCode property holds a numeric code representing the ASP-specific error that occurred in the script that raised the error. This property is populated by IIS if the error occurred in processing the ASP script.
The ASPCode property is read-only.
Parameters
None
Example
This example assumes that the following code has been added to the default custom error script, 500-100.ASP, and that each of the three scripts shown at the end of the Comments/Troubleshooting section is used to raise an error that invokes it:
**** BEGIN ASPCode Example Script **** <% ' This script demonstrates the use of the ASPCode ' property of the ASPError object. Dim objMyASPError Set objMyASPError = Server.GetLastError( ) Response.Write "The value of the ASPCode property is " & objMyASPError.ASPCode %> **** END ASPCode Example Script ****
When the error-generating scripts are executed, the preceding example script generates the following three responses:
Error Generating Script #1:
The value of the ASPCode property is [EMPTY]
Error Generating Script #2:
The value of the ASPCode property is ASP 0128Error Generating Script #3:
The value of the ASPCode property is [EMPTY]
Notes
As previously noted, the ASPCode property is not populated unless the error occurred when interpreting the ASP script itself. This covers all preprocessing directives.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access