| | |
Displaying error line number
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2004
Posts: 1
Reputation:
Solved Threads: 0
Hi
I am creating some error trapping code that will email me when a error occurs in asp code. Alot of
the code works, except perhaps one of the most vital pieces of information line number of the error
I have tried
ASPError.Line
&
set objErr=Server.GetLastError()
objErr.Line
&
Err.Line
I get nothing returned or the object im looking at, or it is errorous. Im using IIS 6. Does anyone
have any ideas of how to get the line number of an error? You would think it would be a important
thing to be able to return and simple too.
Thanks in advance for any help
Rob
I am creating some error trapping code that will email me when a error occurs in asp code. Alot of
the code works, except perhaps one of the most vital pieces of information line number of the error
I have tried
ASPError.Line
&
set objErr=Server.GetLastError()
objErr.Line
&
Err.Line
I get nothing returned or the object im looking at, or it is errorous. Im using IIS 6. Does anyone
have any ideas of how to get the line number of an error? You would think it would be a important
thing to be able to return and simple too.
Thanks in advance for any help
Rob
•
•
Join Date: Sep 2004
Posts: 10
Reputation:
Solved Threads: 0
I have tried the same exact thing. I was never able to get the line number to come up.
The syntax for returning the line number of the ASP error using the GetLastError object is :
Note though that you cannot use this in your standard asp application pages and expect it to work. You need to modify the default error page (500-100.asp) which handles ASP error reporting and displays the results on the screen. To get the error emailed to you you can replace this page with your own version which will display a custom message to the user and then email the error report to you.
ASP Syntax (Toggle Plain Text)
set objError = Server.GetLastError() strErrorLine = objError.Line
Note though that you cannot use this in your standard asp application pages and expect it to work. You need to modify the default error page (500-100.asp) which handles ASP error reporting and displays the results on the screen. To get the error emailed to you you can replace this page with your own version which will display a custom message to the user and then email the error report to you.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.
Lafinboy Productions
:: Website Design :: Website Development ::
Lafinboy Productions
:: Website Design :: Website Development ::
![]() |
Similar Threads
- ERROR at line 1: ORA-01722: invalid number (Oracle)
- The XML parse error 0xc00ce556 occurred on line number 1 (MS SQL)
- Retrieving the number that the of error line of code? (PHP)
- Error at line number 782 named "ios is not declared"... (C++)
- How to print error with line number in using Log4j (Java)
Other Threads in the ASP Forum
- Previous Thread: Time Formatting
- Next Thread: HELP -my Date code isnt working
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





