473,667 Members | 2,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trap errors - 2nd post

Hello,
I want to emphasize a point for my prior posts :

How can I trap a message in ASP (not dotnet), to a specific label.

(I know : on error goto my_label ...
but this does not work in ASP pages)

Thanks :)

Jul 22 '05 #1
3 2334
Whats wrong with Bob's answer to your other post concerning this?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Eitan" <no_spam_please @nospam_please. com> wrote in message
news:#z******** ******@TK2MSFTN GP14.phx.gbl...
Hello,
I want to emphasize a point for my prior posts :

How can I trap a message in ASP (not dotnet), to a specific label.

(I know : on error goto my_label ...
but this does not work in ASP pages)

Thanks :)

Jul 22 '05 #2
Eitan wrote:
Hello,
I want to emphasize a point for my prior posts :

How can I trap a message in ASP (not dotnet), to a specific label.

(I know : on error goto my_label ...
but this does not work in ASP pages)

Thanks :)


One of the links that was provided showed an example, but here's a generic
example:

on error resume next
'bunch of statements
'statement that may generate an error
if err <> 0 then
'handle the error
response.write err.number & ": " & err.description
'use Select Case to tailor your action to specific error numbers
end if
'turn off error handling if appropriate (this is optional*):
on error goto 0
In addition, with ADO, you also can ustilize the connection object's Errors
collection (you still have to us on error resume next)

on error resume next
conn.execute querythatmaypro duceerror
if conn.Errors.cou nt > 0 then
for each adoerr in conn.errors
response.write "<BR>ADO Error #" & adoerr.number & "<BR>" & _
"DB Error #: & ": " & adoerr.nativeEr ror & "<BR>" & _
"Descriptio n: " ": " & adoerr.descript ion
'use Select Case to tailor your action to specific error numbers
next
end if

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #3
Bob Barrows [MVP] wrote:
Eitan wrote:
Hello,
I want to emphasize a point for my prior posts :

How can I trap a message in ASP (not dotnet), to a specific label.

(I know : on error goto my_label ...
but this does not work in ASP pages)

Thanks :)


One of the links that was provided showed an example, but here's a
generic example:

on error resume next
'bunch of statements
'statement that may generate an error
if err <> 0 then
'handle the error
response.write err.number & ": " & err.description
'use Select Case to tailor your action to specific error numbers
end if
'turn off error handling if appropriate (this is optional*):
on error goto 0

This would be better written like this:

on error resume next
'bunch of statements whose errors you wish to ignore
....
....
....
'statement that may generate an error you wish to handle
err.clear
....
if err <> 0 then
'handle the error
response.write err.number & ": " & err.description
'use Select Case to tailor your action to specific error numbers
end if
'turn off error handling if appropriate (this is optional*):
on error goto 0

*Eric Lippert wrote a series of blogs about error-handling in vbscript,
which you can find here:
http://blogs.msdn.com/ericlippert/category/2528.aspx

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #4

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

Similar topics

31
9802
by: lawrence | last post by:
I'm not sure how this is normally done, on a large site, perhaps one running Phorum. Occassionally a thread will have hundreds of entries, perhaps a meg or two worth of data. You won't necessarily print all that to the screen, but PHP has to hold it in memory. Run some operations on it, or, more likely, have an array that you keep adding things to, and very soon you run into the 8 meg limit that is the default limit for PHP scripts. ...
10
2433
by: Mike D | last post by:
I have a table in SQL 2000 with a composite Primary Key on coulumns Instrument_ID (int) and WeekOf (smalldatetime.) I am running asp on win 2003. I insert values using a stored procedure from this ASP: InsertSQL = "Execute osp_insert_Instrument_Schedule " InsertSQL = InsertSQL & "@UserName = '" & strUserName & "', " InsertSQL = InsertSQL & "@DateInput = '" & Date() & "', " InsertSQL = InsertSQL & "@Instrument_ID = " & strInstrument_ID &...
1
5969
by: gregory_may | last post by:
This code seems to "work" but I get the following errors: An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll then this one: An unhandled exception of type 'System.ExecutionEngineException' occurred in system.windows.forms.dll Anyone know how to either trap these errors or prevent them from happening?
3
4069
by: Detlev Ahlgrimm | last post by:
Hi! I have to use MS-Access2000 as a frontend for an oracle database. And I dont want to see these ORA-xxxx Popups if an error occures. So I use something like the following in access (it should work with sql-server....): Private Sub Form_Error(DataErr As Integer, Response As Integer) Dim errX As DAO.Error
1
2459
by: sam | last post by:
Hi, I have seen many posts about this problem and no resolution. I have set the maxRequestLength to 200K as I don't want anyone uploading files to the server greater than this size. I have put code into Application_BeginRequest and Application_Error to try and trap the error of "Page Not Found". Nothing seems to stop the inevitable of the browser going to the "Page Not Found" page. I have
2
339
by: ramu | last post by:
Hi, I read the phrase " trap representation" in the topic "Union arrangement" in this group. Can you please tell me what do you mean by it? regards
10
2351
by: pemo | last post by:
As far as I understand it, a trap representation means something like - an uninitialised automatic variable might /implicitly/ hold a bit-pattern that, if read, *might* cause a 'trap' (I'm not sure what 'a trap' means here - anyone?). I also read into this that, an *initialised* automatic variable, may never hold a bit pattern that might, when read, cause a 'trap'. I.e., if an auto is explicitly initialised, it may *never* hold a...
5
2674
by: rod.weir | last post by:
Hello, I have the following code to iterate through each view in a SQL Server and call the "sp_refreshview" command against it. It works great until it finds a view that is damaged, or otherwise cannot be refreshed. Then the whole routine stops working. Can someone please help me re-write this code so that any views that fail the "sp_refreshview" command get skipped. I'm sure it's just a matter of putting some basic error trapping...
1
1967
by: Massimiliano Campagnoli | last post by:
Hi All, I know that db2 V7.2 is no more supported and nor OS/2 is supported anymore but I wonder if someone here can give me some help on this. Platform: DB2 V7.2 FixPak 14 OS: OS/2 (actually ECS 1.2 latest fixpak) I've migrated our production database from DB2 V5.2 to V7.2 GA for OS/2 which is the latest available for this platform. Migration succeded and database works OK.
0
8459
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8367
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8570
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7391
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6206
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2781
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.