Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Insertions and updates in C++ Microsoft Jet DAO MFC applications may not work on a computer that is running Windows Vista Service Pack 1 or Windows Server 2008


View products that this article applies to.

Symptoms

In a C++ Microsoft Jet DAO MFC (CDao) application, insertions and updates may not work on a computer that is running Windows Vista Service Pack 1 (SP1) or Windows Server 2008. Additionally, you may receive the following error message:
The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.
Note If the application does not capture the exception that is returned by CDao on the insertion or the update, the database will not have the updates that you intended to make.

↑ Back to the top


Cause

This problem occurs when all the following conditions are true:
  • The application is written in Microsoft Visual C++ and uses the CDao classes to access a Microsoft Jet database data source.
  • The Use Multi-Byte Character Set value is set for the Character Set project option.
  • The data that the application is inserting or updating was retrieved from a fixed-length defined Text column.
  • The source Text column contains data that is the maximum length that the column allows. For example, a Text(10) column contains a value of 1234567890.
  • Successive insertions or updates occur from the original variable that is returned from the CDaoRecordset object.
  • The target table column is one of the following columns:
    • The same column from which the original data was retrieved
    • Another fixed-length column that is defined as a Text column of the same size

↑ Back to the top


Resolution

To resolve this problem, apply the hotfix that is described in Microsoft Knowledge Base article 943509.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:
943509 Description of the Jet 4.0 Database Engine hotfix package for Windows XP Service Pack 2, Windows Server 2003 Service Pack 1, Windows Server 2003 Service Pack 2, Windows Vista, Windows Vista Service Pack 1, and Windows Server 2008: October 23, 2007

↑ Back to the top


Workaround

If you cannot apply the hotfix that is described in Microsoft Knowledge Base article 943509, use one of the following methods to work around this problem:
  • Update the application. To do this, copy the retrieved data from the original Visual C++ variable to a new variable. Then, insert or update the data from the new variable.
  • Update the database design. To do this, use one of the following methods:
    • Modify the column widths to one character larger than any expected data.
    • Redefine the width as a non-fixed length.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


Keywords: kbtshoot, kbpubtypekc, kberrmsg, kbprb, KB952337

↑ Back to the top

Article Info
Article ID : 952337
Revision : 2
Created on : 5/15/2008
Published on : 5/15/2008
Exists online : False
Views : 526