BUG: Err Object Returns Zero Number and Empty Description. (255625)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q255625 SYMPTOMS
After an object raises a trappable error, the client checks the Err object and finds that the error number is zero and the error description is empty.
CAUSE
This problem occurs only when the client application is compiled to native code and when the client does not have a local or global variable that stores a reference to the object that raises the error.
Assume that you have an object called Object1 and it has a property called ChildObject that returns a reference to another object, Object2. If you call a method on Object2 using a syntax such as:
Object1.ChildObject.Method
you see this type of behavior because no variable holds a reference to Object2.
RESOLUTION
The workaround for this problem is to assign an object to a variable and avoid using the preceding syntax. Do the following:
Dim MyObject as Object2
Set MyObject = Object1.ChildObject
' call the method using the MyObject variable
MyObject.Method
Another workaround is to compile your project to p-code.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | kbBug kbnofix KB255625 |
---|
|