ACC: Cannot Trap ODBC Errors with Form OnError Property Code

Last reviewed: May 14, 1997
Article ID: Q124395
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0

SYMPTOMS

Advanced: Requires expert coding, interoperability, and multiuser skills.

Even though you have specified event procedure code to trap errors in your form's OnError property, you still receive ODBC error messages.

CAUSE

ODBC error messages normally occur in two parts. The first part is

   ODBC call failed

followed by a second part such as:

   [Microsoft][ODBC SQL Server Driver][SQL Server] <Server-specific
   error message>

The first part of the error message can be trapped by the code specified in the OnError property, but the second part cannot. The second part of the error message appears on the screen after the event procedure code finishes running.

RESOLUTION

If the ODBC error is triggered by a procedure that contains a routine to handle errors (rather than by a form), the procedure will be able to trap both parts of the error message.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 2.0 and 7.0. This problem no longer occurs in Microsoft Access 97.


Keywords : FmsEvnt kberrmsg kbusage
Version : 2.0 7.0
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : Info_Provided


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.