Article ID: 173645 - Last Review: October 15, 2002 - Revision: 1.0 FIX: Access Violation in MSDAER.DLL with _com_error ExceptionsThis article was previously published under Q173645 SYMPTOMS
When using the compiler #import feature, ADO, the OLE DB 1.1 ODBC Provider,
and trapping _com_error exceptions, an access violation occurs in
MSDAER.DLL when closing an application.
CAUSE
A method created with #import can throw a _com_error exception. When it
throws the exception, Release() is not called on the IErrorInfo pointer
which is returned from GetErrorInfo(). This leaves the internal error
object in the OLEDB ODBC Provider stranded which causes the access
violation to occur as the application shuts down.
RESOLUTION
Create a macro which can be used to Release() the IErrorInfo interface at
the end of the "catch" block. For example:
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Studio
97 Service Pack 3 and Visual C++ version 6.0.
For more information, please see the following article in the Microsoft Knowledge Base: 170365
(http://support.microsoft.com/kb/170365/EN-US/
)
INFO: Visual Studio 97 Service Packs - What, Where, and Why
| Article Translations
|

Back to the top
