FIX: Text Truncated When Using Dynaset and RFX_Text()Last reviewed: September 18, 1997Article ID: Q125727 |
2.00
WINDOWS NT
kprg kbfixlist kbbuglist
The information in this article applies to:
SYMPTOMSWhen editing a record with a text field, the text gets truncated to the length of the previous value. For example, if a text field has the value "ABC" and an application attempts to change the value to "TEST," the result is "TES." This occurs when opening a CRecordset with CRecordset::dynaset as the first argument of CRecordset::Open() and using RFX_Text() to map the field to a CRecordset member variable.
CAUSEThe CFieldExchange::Default() function, located in \MSVC20\MFC\SRC\DBRFX.CPP, contains the following code: case BindFieldForUpdate: if (!m_prs->IsFieldFlagDirty(nField, m_nFieldType)) { // If field is not dirty, set bound length to SQL_IGNORE // for SQLSetPos updates *plLength = SQL_IGNORE; } else if ((m_prs->m_nEditMode == CRecordset::addnew) && (!m_prs->IsFieldFlagNull(nField, m_nFieldType))) { // plLength always set to SQL_NULL_DATA in AddNew mode *plLength = cbValue; } return;The second If statement shouldn't check for only CRecordset::addnew because this also applies to updates.
RESOLUTIONTo work around this problem, perform these steps:
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++ version 2.1.
|
Additional reference words: 2.00 3.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |