473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 2301
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**************@TK2MSFTNGP14.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 querythatmayproduceerror
if conn.Errors.count > 0 then
for each adoerr in conn.errors
response.write "<BR>ADO Error #" & adoerr.number & "<BR>" & _
"DB Error #: & ": " & adoerr.nativeError & "<BR>" & _
"Description: " ": " & adoerr.description
'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
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...
10
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...
1
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...
3
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...
1
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...
2
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
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...
5
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...
1
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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,...
0
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...

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.