473,326 Members | 2,048 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,326 software developers and data experts.

Err.Number And Exceptions

I have this ancient application that was originally created in VB4 and
has been upgraded and upgraded. The application is massive and uses
the Err object and the owners will not pay for a rewrite of the error
handling (why would they it works).

With new code additions I use try-catch-err.raise and although it
works I'm uncomfortable with mixing err object and exceptions.

try
......
catch
err.raise
end try

I created a subclass of exception so that I could throw a custom
exception instead of using err.raise. In this subclass I set the
HResult as this appears to correspond to err.number, however when I
throw this exception the resulting err.number always becomes 5 no
matter what I set it to.

Does anyone know if it is possible to set err.number when using an
exception?
Nov 21 '05 #1
0 915

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

Similar topics

9
by: Mark Twombley | last post by:
Hi, I'm just getting back into C++ and had a question about the best practice for assigning error numbers. I have been working in VB for sometime now and there you would start assigning error...
2
by: Mike | last post by:
How do I select a number field from oracle 9i? The field is a number(integer). I have this line in my datareader: double dbid; dbid = dr.GetDecimal(0); I have tried getstring, convert and...
6
by: Kirk | last post by:
I have several routines that use the Try-Catch-EndTry method. When an error occurs in one of these routines, I display it like this: Catch ex As Exception MsgBox("Error #" & Err.Number & ": " &...
1
by: Anonieko | last post by:
Understanding and Using Exceptions (this is a really long post...only read it if you (a) don't know what try/catch is OR (b) actually write catch(Exception ex) or catch{ }) The first thing I...
28
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I convert a Number into a String with exactly 2 decimal places?...
11
by: RP | last post by:
If an exception occurs, how to get the error number. I mean, is there anything like ex.number?
63
by: deepak | last post by:
Hi, Can someone give the standard function which can create positive integer value in C? Thanks, Deepak
0
RedSon
by: RedSon | last post by:
Chapter 3: What are the most common Exceptions and what do they mean? As we saw in the last chapter, there isn't only the standard Exception, but you also get special exceptions like...
3
by: Kevinst | last post by:
Hello, I have a c# com object that exposes several methods. This com object is to be used in vbscripts as well as vba scripts. In my application error handling is done by throwing different...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.