Microsoft KB Archive/118421

{|
 * width="100%"|

PRB: L2029 Error for CRecordset::Check

 * }

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 kbDatabase kbMFC kbODBC kbVC

Issue type :

Technology : kbAudDeveloper kbMFC