The information in this article applies to:
SYMPTOMSRunning an application built using the MFC ODBC classes from Visual C++ 4.0 or 4.1 to retrieve CLongBinary data from a database may result in data truncation. If you're using Visual C++ 4.1, the truncation is only evident in release builds; debug builds work as expected. CAUSE
There is a programming error in the MFC code that can lead to this
behavior. MFC expects SQL_NO_TOTAL to be the return code of the
::SQLGetData() ODBC API. SQL_NO_TOTAL is used by some drivers when
retrieving long binary data. In reality, SQL_NO_TOTAL will be returned as a
value of one of the parameters of ::SQLGetData().
RESOLUTION
A new implementation of RFX_LongBinary that avoids this defect in the MFC
code is available to assist you in correcting this problem. Simply download
the file as described below, run the .exe to expand the source files, and
then incorporate them into your project. Replace all occurrences of
RFX_LongBinary with the new RFX_LongBinary_Alloc and rebuild.
Alloc.exeFor more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base: Q119591 How to Obtain Microsoft Support Files from Online Services STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ 32- bit Edition version 4.2. Additional query words: kbVC400bug 4.00 4.10 4.20
Keywords : kbDatabase kbMFC kbODBC kbVC kbVC420fix |
Last Reviewed: January 31, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |