FIX: "SQLPutData Length exceeded" for Data Exceeding 64K

Last reviewed: September 19, 1997
Article ID: Q140533
1.50 1.51 WINDOWS kbprg kbbuglist kbfixlist

The information in this article applies to:

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

SYMPTOMS

The following ODBC error message may occur when you use one of the Desktop Database ODBC Drivers provided with Visual C++ version 1.5:

   Maximum SQLPutData length exceeded.
   State:22001,Native:0,Origin:[Microsoft][ODBC Single-Tier Driver]

CAUSE

The ODBC error message (22001) is caused by a bug in the Desktop Database ODBC drivers (such as FoxPro, Microsoft Access, and so on) included in Visual C++ version 1.5. Specifically, the Desktop Database drivers are not permitting multiple SQLPutData() ODBC API calls to exceed 64K for a parameter used in an SQL UPDATE statement. We have confirmed this to be a bug in the Desktop Database ODBC Drivers versions 1.01.1928 and 1.01.2115.

RESOLUTION

Because inserts do not cause the ODBC error, the workaround for this bug is to retrieve the values of the record, delete the record, change any values you want to update, and then add the record to the table.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Visual C++ version 1.52 for Windows. It is related to the 1.0-level Desktop Database ODBC Drivers that shipped with Visual C++ versions 1.5 and 1.51. Visual C++ version 1.52 ships with the new 2.0-level Desktop Database ODBC Drivers.


Additional reference words: 2.50 2.51 2.52
KBCategory: kbprg kbfixlist kbbuglist
KBSubcategory: MFCDatabase
Keywords : MfcDatabase kbbuglist kbfixlist kbprg
Technology : kbMfc
Version : 1.50 1.51
Platform : WINDOWS
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 19, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.