Greetings.
I am having difficulty with the ASPError Object and I scoured other sources to no avail.
(IIS5, ASP 3.0, Windows 2000 Adv Server)
My goal is to display a more intuitive error as part of an ASP page, but it seems I can only get back a limited number of parameters. I commented out a line so that an error would occur.
Here's my code:
Towards the top of my document I have:
On Error Resume Next
Then towards the bottom I have:
If Err.Number <> 0 Then
Set objASPError = Server.GetLastError
Response.Write "File: " & objASPError.File & "<br />" & VbCrLf
Response.Write "Line: " & objASPError.Line & "<br />" & VbCrLf
Response.Write "Column: " & objASPError.Column & "<br />" & VbCrLf
Response.Write "Number: " & objASPError.Number & "<br />" & VbCrLf
Response.Write "Source: " & objASPError.Source & "<br />" & VbCrLf
Response.Write "ASPCode: " & objASPError.ASPCode & "<br />" & VbCrLf
Response.Write "Category: " & objASPError.Category & "<br />" & VbCrLf
Response.Write "Description: " & objASPError.Description & "<br />" & VbCrLf
Response.Write "ASPDescription: " & objASPError.ASPDescription & "<br />" & VbCrLf
End If
Here's what I expected:
File: mydocument.asp
Line: 350
Column: 10
Number: 0
Source: Microsoft OLE DB Provider for SQL Server error '80040e14'
ASPCode:
Category:
Description: Incorrect syntax near ')'.
ASPDescription:
Here's what I get:
File:
Line: 0
Column: 0
Number: 0
Source:
ASPCode:
Category:
Description:
ASPDescription:
So, what am I missing here? I even copy-pasted part of the 500-100.asp doc that's part of IIS, but I get the same result.
TIA!
Dave![[idea] [idea] [idea]](/data/assets/smilies/idea.gif)
[]
I am having difficulty with the ASPError Object and I scoured other sources to no avail.
(IIS5, ASP 3.0, Windows 2000 Adv Server)
My goal is to display a more intuitive error as part of an ASP page, but it seems I can only get back a limited number of parameters. I commented out a line so that an error would occur.
Here's my code:
Towards the top of my document I have:
On Error Resume Next
Then towards the bottom I have:
If Err.Number <> 0 Then
Set objASPError = Server.GetLastError
Response.Write "File: " & objASPError.File & "<br />" & VbCrLf
Response.Write "Line: " & objASPError.Line & "<br />" & VbCrLf
Response.Write "Column: " & objASPError.Column & "<br />" & VbCrLf
Response.Write "Number: " & objASPError.Number & "<br />" & VbCrLf
Response.Write "Source: " & objASPError.Source & "<br />" & VbCrLf
Response.Write "ASPCode: " & objASPError.ASPCode & "<br />" & VbCrLf
Response.Write "Category: " & objASPError.Category & "<br />" & VbCrLf
Response.Write "Description: " & objASPError.Description & "<br />" & VbCrLf
Response.Write "ASPDescription: " & objASPError.ASPDescription & "<br />" & VbCrLf
End If
Here's what I expected:
File: mydocument.asp
Line: 350
Column: 10
Number: 0
Source: Microsoft OLE DB Provider for SQL Server error '80040e14'
ASPCode:
Category:
Description: Incorrect syntax near ')'.
ASPDescription:
Here's what I get:
File:
Line: 0
Column: 0
Number: 0
Source:
ASPCode:
Category:
Description:
ASPDescription:
So, what am I missing here? I even copy-pasted part of the 500-100.asp doc that's part of IIS, but I get the same result.
TIA!
Dave
![[idea] [idea] [idea]](/data/assets/smilies/idea.gif)
[]