473,499 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server.GetLastError() does not work?!?

I have a program that I'm trying to get error detection to work with. To
test it, I attempted using the following mispelled CreateObject statement
(which should cause an error):

Set myObject = CreateObject("ADODB.Connectiom")

Err.Number shows 429, which is normal. But Server.GetLastError reports no
error!

I would like to have line numbers and the line of source code, along with
the file name, of the offending code.

Any suggestions?
Jul 19 '05 #1
3 2920
Server.GetLastError() is only available in a custom 500 error handler page.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"ASP.Confused" <anonymous@> wrote in message
news:eR*************@tk2msftngp13.phx.gbl...
I have a program that I'm trying to get error detection to work with. To
test it, I attempted using the following mispelled CreateObject statement
(which should cause an error):

Set myObject = CreateObject("ADODB.Connectiom")

Err.Number shows 429, which is normal. But Server.GetLastError reports no
error!

I would like to have line numbers and the line of source code, along with
the file name, of the offending code.

Any suggestions?

Jul 19 '05 #2
Any ideas on how I can get the line number of the command that has the error
on it without using a custom HTTP 500-100 error handler page? I cannot set
my site to use it, since it is hosted by another company (and they can't
change it because we're on a secure server sharing one certificate, and
changing it for us would change it for everyone.)

"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
Server.GetLastError() is only available in a custom 500 error handler page.
--
http://www.aspfaq.com/
(Reverse address to reply.)


"ASP.Confused" <anonymous@> wrote in message
news:eR*************@tk2msftngp13.phx.gbl...
I have a program that I'm trying to get error detection to work with. To test it, I attempted using the following mispelled CreateObject statement (which should cause an error):

Set myObject = CreateObject("ADODB.Connectiom")

Err.Number shows 429, which is normal. But Server.GetLastError reports no error!

I would like to have line numbers and the line of source code, along with the file name, of the offending code.

Any suggestions?


Jul 19 '05 #3
No, I don't think line number is available to the err collection using the
stock asp error handling.

--
http://www.aspfaq.com/
(Reverse address to reply.)

"ASP.Confused" <anonymous@> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Any ideas on how I can get the line number of the command that has the
error
on it without using a custom HTTP 500-100 error handler page? I cannot
set
my site to use it, since it is hosted by another company (and they can't
change it because we're on a secure server sharing one certificate, and
changing it for us would change it for everyone.)

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8296
by: ad | last post by:
I use GenericErrorPage.aspx for the redirect page when some error occur. I want to show some different according error statusCode . How can I get error statusCode form Server.GetLastError()?
1
7952
by: Christopher | last post by:
Try using the Application_Error() event in Global.asax. The context of the error will be available here. Your application is handling the error, and thus there is no LastError to Get. hth,...
2
2114
by: Lars Netzel | last post by:
I'm trying to make my own custom error page... but when using Try lblErrormessage.Text = Server.GetLastError.Message lblErrormessage.Text += "<br>" & Server.GetLastError.StackTrace ...
6
4585
by: José Joye | last post by:
Hello, I'm currently reading the MS Developing Web applications with c# (and VB.net). In the chapter related to Error management, there is a sample about "Page-Level Error Pages" eg: In my...
4
4103
by: VK | last post by:
Hello, I am trying to get the last occured error via the following code: Sub Page_Load(...) Dim zero As Integer = 0 Try Dim err As Integer = 10 / zero Catch ex As Exception
7
8992
by: jtfaulk | last post by:
I need to encode some information on the server side using ASP.NET with C#; sending via HTTP to a client side application, that needs to be decoded in an MFC C++ application. I'm not sure if I...
2
4241
by: Richard Coltrane | last post by:
Hi there, Ive just implemented some application level exception handling in ASP.Net 2.0. I deliberately set up a null reference error in my code to see how this would be handled. Sure enough...
2
12155
by: Seguros Catatumbo | last post by:
Hello guys, i am trying to port my custom asp 3.0 error page to asp.net. I want to disable debugging in my asp.net projects but i want to show the users a pretty page but that page should send me...
7
3618
by: wwhitman | last post by:
I'm having issues transferring a file from a WEB client running a C++ application to a PHP server script. I have debugged through the C++ side and no errors are reported, but the file does not appear...
0
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.