Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASPError object

Status
Not open for further replies.

ElEye

IS-IT--Management
Nov 17, 2001
187
US
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]
[]
 
I have never had any luck with returning the values you are trying to return either... maybe try showing me the code you are having errors on and then you can solve the problem then there will not be an error to handle...

Jason
 
I have IIS on my Windows 2000 Web server where we have Cold Fusion running. Please advise if or how I can develop ASP on IIS? Is there special software that I need?
 
just open up your web design software and name the file

default.asp


then put it in the folder


put the following code:

<%

Response.write "<br><br><Br><br><Br><Center>This was written in ASP<br><br>" & NOW() & "</center>"


%>


If you don't have a web design editor then open up notepad and save the file as "default.asp" with quotes so it keeps the extension...


If you want to learn ASP then I recommend this website:



Personally if I were to learn a language now adays i would probably go with asp.net or PHP... but thats just me... i learned ASP forever ago... and its hard to switch to something else when you know another "older" language so well... But ASP can handle alot of people i think... i never had any problems.. I use MySQL database... so that helps ;)


Jason




Army : Combat Engineer : 21B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top