Err.Raise Problem 
Author Message
 Err.Raise Problem

Trying to trap errors using err.raise from VB6 Prof. Ed. Even though "break
on unhandled errors" is set, the following dialog box is presented when an
error is detected in a simple program designed to signal too much input for
a SSN.

 Run-time error '-2147220503(800403e9)'
 SSN Too Long
 Continue (grayed out!) End (gasp!) Debug (gasp again!) Help

The specific statement is: Err.Raise vbObjectError+1001,"Person","SSN Too
Long"

If the vbObjectError portion is removed, the message changes to read:

 Run-time error 1001
 SSN Too Long
 Continue (grayed out!) End (gasp!) Debug (gasp again!) Help

 That is, VB 6.0 seems to treat the err.raise as virtually
 fatal and posts only the message but gives no viable recovery
 options. Setting the break on error options differently only worsens the
matter. I can
 find no information on this problem at the Microsoft site so I do
 worry about it somehow being a 'local' problem. Am running NT 4, SP4
 as well as the above. Would greatly appreciate any assistance as this
behavior inhibits general error handling coding we are trying to implement.



Mon, 20 Aug 2001 03:00:00 GMT  
 Err.Raise Problem
Al,

Press Ctrl-L and have a look at the call stack.

If the error is being raised, and there is no errorhandler in the call
stack, then it will either break (stop) in the IDE, or die if compiled.

Matthew



Quote:
> Trying to trap errors using err.raise from VB6 Prof. Ed. Even though
"break
> on unhandled errors" is set, the following dialog box is presented when
an
> error is detected in a simple program designed to signal too much input
for
> a SSN.

>  Run-time error '-2147220503(800403e9)'
>  SSN Too Long
>  Continue (grayed out!) End (gasp!) Debug (gasp again!) Help

> The specific statement is: Err.Raise vbObjectError+1001,"Person","SSN Too
> Long"

> If the vbObjectError portion is removed, the message changes to read:

>  Run-time error 1001
>  SSN Too Long
>  Continue (grayed out!) End (gasp!) Debug (gasp again!) Help

>  That is, VB 6.0 seems to treat the err.raise as virtually
>  fatal and posts only the message but gives no viable recovery
>  options. Setting the break on error options differently only worsens the
> matter. I can
>  find no information on this problem at the Microsoft site so I do
>  worry about it somehow being a 'local' problem. Am running NT 4, SP4
>  as well as the above. Would greatly appreciate any assistance as this
> behavior inhibits general error handling coding we are trying to
implement.



Mon, 20 Aug 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Err.Raise in OLE Server EXE not raising error in calling program

2. Err.Raise - error not being re-raised all the way to top of the call stack

3. Problems when using Err.Raise in a public method of an activex

4. Problems when using Err.Raise in a public method of an activex

5. Problems with Err.Raise in a class module.

6. Problem with Err.Raise and ByRef output arguments.

7. Problems when using Err.Raise in a public method of an activex

8. Err.Raise Causes Automation Error

9. Raising Err in Class Module

10. Err.Raise Number starting point

11. err.raise not trappable in class module

12. Err.Raise causes Error

 

 
Powered by phpBB® Forum Software