The information in this article applies to:
SYMPTOMS
Opening a recordset as an append-only snapshot with no cursor library
support leads to an internal application error (ICE) when Update() is
called to commit an AddNew(). A CDBException is thrown and the following
error is displayed in the output window of the debugger (DB tracing
enabled): This happens when the cursor library is inhibited from loading by passing FALSE as the last parameter to CDatabase Open() prior to opening the recordset or if the cursor library fails to load for any reason. CAUSE
A snapshot recordset relies on the cursor library for additions or updates
to the database. If the cursor library is not loaded, the recordset becomes
read-only and does not allow additions or updates. In this case, the
recordset member variable m_bUpdatable is correctly set to FALSE, but due
to a bug in MFC, if the recordset is opened appendOnly, m_bAppendable is
still set to TRUE. AddNew() checks m_bAppendable and continues to process
the addition. Eventually, Update() is called. Because the cursor library is
not present, Update() calls CRecordset::ExecuteSetPosUpdate() to use
SQLSetPos for performing the update. SQLSetPos fails and generates the
error message.
RESOLUTIONSnapshots become read-only if the cursor library is not loaded. To get an updatable and appendable snapshot, make sure the cursor library is properly loaded by the application. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ version 4.0. Additional query words: 2.00 3.00 2.10 3.10 2.20 3.20
Keywords : kbDatabase kbMFC kbODBC kbVC |
Last Reviewed: July 26, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |