Error handling / Arithmetic overflow error 
Author Message
 Error handling / Arithmetic overflow error

I've written a VB.NET program that interfaces with another
API. When I call a save routine from the API, I'm getting
a [Microsoft][ODBC SQL Server Driver][SQL Server]
Arithmetic overflow error converting numeric to data type
numeric error. I need to be able to catch this error in my
program and log it to a file. So far, no exceptions I've
tried have worked. Can anyone help me?

Thanks.



Sun, 16 Oct 2005 00:44:54 GMT  
 Error handling / Arithmetic overflow error
|
| I've written a VB.NET program that interfaces with another
| API. When I call a save routine from the API, I'm getting
| a [Microsoft][ODBC SQL Server Driver][SQL Server]
| Arithmetic overflow error converting numeric to data type
| numeric error. I need to be able to catch this error in my
| program and log it to a file. So far, no exceptions I've
| tried have worked. Can anyone help me?

Did you try catching a generic Exception and then debugging to find out
what type of exception was *really* thrown?

Try
      ... the problem statement(s)...
Catch ex As Exception
     MsgBox( ex.ToString() )
End Try

Just look at both the type shown in the MsgBox and any other info in there
that might be helpful in identifying the exact error when it occurs and
when you then catch it, explicitly.

Bill Wilkinson
VB.Net Team, Microsoft Corporation



Mon, 17 Oct 2005 05:01:20 GMT  
 Error handling / Arithmetic overflow error
Hi Bill,

Here's what my code looks like:

Try
     intResult = obj.Save
Catch exc as Exception
     MsgBox(exc.Exception)
End Try

The error is generated by the Save method. intResult returns zero
(indicating a successful save) regardless of the error. I don't know
what's happening in the Save method, except that I do know it doesn't
catch errors. I've tried a number of different exceptions to try and
catch the error and none have worked.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 17 Oct 2005 06:01:37 GMT  
 Error handling / Arithmetic overflow error

Quote:
> Hi Bill,

> Here's what my code looks like:

> Try
>      intResult = obj.Save
> Catch exc as Exception
>      MsgBox(exc.Exception)
> End Try

> The error is generated by the Save method. intResult returns zero
> (indicating a successful save) regardless of the error. I don't
> know what's happening in the Save method, except that I do know
> it doesn't catch errors. I've tried a number of different
> exceptions to try and catch the error and none have worked.

How do you know that there's an exception if no exception is thrown?? How
did you notice the "Arithmetic overflow error" at all?

--
Armin



Mon, 17 Oct 2005 10:36:28 GMT  
 Error handling / Arithmetic overflow error
An error dialog box pops up on the screen (with the text I included in
my post and with a Data Layer Error name on the pop-up) and my program
stops all processing until the OK button on the dialog is clicked.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 17 Oct 2005 20:51:20 GMT  
 Error handling / Arithmetic overflow error
Hi Bill,

Here's what my code looks like:

Try
     intResult = obj.Save
Catch exc as Exception
     MsgBox(exc.Exception)
End Try

The error is generated by the Save method. intResult
returns zero (indicating a successful save) regardless of
the error. I don't know what's happening in the Save
method, except that I do know it doesn't catch errors.
I've tried a number of different exceptions to try and
catch the error and none have worked.

Quote:
>-----Original Message-----
>|
>| I've written a VB.NET program that interfaces with
another
>| API. When I call a save routine from the API, I'm
getting
>| a [Microsoft][ODBC SQL Server Driver][SQL Server]
>| Arithmetic overflow error converting numeric to data
type
>| numeric error. I need to be able to catch this error in
my
>| program and log it to a file. So far, no exceptions
I've
>| tried have worked. Can anyone help me?

>Did you try catching a generic Exception and then

debugging to find out
Quote:
>what type of exception was *really* thrown?

>Try
>      ... the problem statement(s)...
>Catch ex As Exception
>     MsgBox( ex.ToString() )
>End Try

>Just look at both the type shown in the MsgBox and any

other info in there

- Show quoted text -

Quote:
>that might be helpful in identifying the exact error when
it occurs and
>when you then catch it, explicitly.

>Bill Wilkinson
>VB.Net Team, Microsoft Corporation

>.



Mon, 17 Oct 2005 22:07:17 GMT  
 Error handling / Arithmetic overflow error

Quote:
> An error dialog box pops up on the screen (with the text I
> included in my post and with a Data Layer Error name on the
> pop-up) and my program stops all processing until the OK button
> on the dialog is clicked.

It seems to be a dialog box of the ODBC SQL Server driver. I'm not sure. If
it's not an exception, you can't catch it, you can only find out what's the
cause and get rid of it.

--
Armin



Mon, 17 Oct 2005 21:34:13 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. arithmetic overflow without overflow

2. Overflow error, error number 6, in VB6 using Crystal Reports 7

3. Cause of error (error 6 overflow) in Windows 2000

4. Arithmetic operation resulted in an Overflow in FilePut

5. Arithmetic Overflow

6. unsigned 32 bits integer arithmetic / overflow

7. Arithmetic Overflow!! Help

8. Arithmetic overflow after control event

9. Arithmetic Overflow

10. errors in arithmetic

11. VB6 Newbie Arithmetic error

12. Error with error handling

 

 
Powered by phpBB® Forum Software