PRB: L2029 Error for CRecordset::Check()

Last reviewed: July 18, 1997
Article ID: Q118421
1.50 WINDOWS kbprg kbprb

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC), included with: Microsoft Visual C++ for Windows, version 1.5

SYMPTOMS

The following message may be displayed when you build an application that uses the database classes of the MFC Library:

    error L2029: 'public: virtual int __far __pascal
          CRecordset::Check(short)const __near' : unresolved external

CAUSE

The database classes included with the MFC, version 2.5, were designed for use with the Open Database Connectivity (ODBC) version 1.0 Software Development Kit (SDK) components. If you are using the header files (.H files) included with the ODBC version 2.0 SDK, you will see the L2029 error message shown above.

The CRecordset::Check() function declares a RETCODE as a parameter. RETCODE is defined as an "int" in the SQL.H file included with Visual C++, version 1.5. RETCODE is defined as "signed short" in the SQL.H file included with the ODBC version 2.0 SDK. Because C++ decorates function names based on parameter types, the L2029 error occurs.

RESOLUTION

Do not use the ODBC version 2.0 SDK header files. Remove them from your INCLUDE path. In the Visual C++ Workbench, choose Directories from the Options menu and remove any reference to the ODBC version 2.0 SDK "include" directory.

MORE INFORMATION

Beginning with Microsoft Visual C++ for Windows, version 1.51, and Microsoft Visual C++, 32-bit Edition, version 2.0, the SQL.H file provided is compatible with that provided with the ODBC version 2.0 SDK. The SQL.H file provided with those and newer versions of Visual C++ defines RETCODE as a signed short.


Additional reference words: 1.50 2.50 2.00
KBCategory: kbprg kbprb
KBSubcategory: MfcDatabase
Keywords : kb16bitonly MfcDatabase kbprb kbprg
Technology : kbMfc
Version : 1.50
Platform : WINDOWS


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: July 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.