FIX: SQLGetData() Returns SQL_NO_TOTAL in RFX_LongBinary()

Last reviewed: September 18, 1997
Article ID: Q132399
The information in this article applies to:
  • The Microsoft Foundation Classes (MFC) included with: - Microsoft Visual C++ for Windows, version 1.52 - Microsoft Visual C++, 32-bit Edition, versions 2.1, 4.0

SYMPTOMS

An assertion may occur in RFX_LongBinary() if an ODBC driver returns a value of SQL_NO_TOTAL (-4) in the location pointed to by plLength after calling SQLGetData().

CAUSE

The MFC RFX_LongBinary() function assumes that an ODBC driver won't return SQL_NO_TOTAL from SQLGetData(). This is by design.

RESOLUTION

If you must use RFX_LongBinary() to map a binary field to a CLongBinary variable, use the RFX_LongBinary() function in BLOBRFX.EXE. BLOBRFX.EXE, a self-extracting file, contains two files: BLOBRFX.CPP and BLOBRFX.H. BLOBRFX.CPP contains an RFX_LongBinary2() function, which can be used in place of RFX_LongBinary() in your CRecordset's DoFieldExchange() function. BLOBRFX.H contains the prototype for the RFX_LongBinary2() function.

The following file is available for download from the Microsoft Software Library:

 ~ Blobrfx.exe (size: 18980 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

NOTE: If you are using a precompiled header in your project, you may want to add the following line of code to the top of BLOBRFX.CPP:

   #include "stdafx.h"

STATUS

This behavior is by design. This problem was corrected in Visual C++ version 4.2 and above.

REFERENCES

The ODBC Programmer's Reference in the Visual C++ Online Books provides information about SQLGetData().


Additional query words: Oracle
Keywords : MfcDatabase kbfile kbprg
Technology : kbMfc
Version : 1.52 2.1 4.0
Platform : NT WINDOWS
Issue type : kbprb
Solution Type : kbfix


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