The information in this article applies to:
SYMPTOMSCDaoRecordView depends on an instance of CDaoRecordset to display data. The CDaoRecordView class also needs to stay in synchronization with the current record displayed by the CDaoRecordset instance. Calling the Seek, MoveFirst, MoveNext, or other methods directly on the CDaoRecordset being used by a CDaoRecordView causes the CDaoRecordView to behave incorrectly. CAUSECDaoRecordView uses four member variables to keep track of bookkeeping information. The first three variables listed below store bookmarks for the first, last, and current record. The fourth variable is used to enable or disable the toolbar buttons corresponding to MoveFirst, MovePrev, MoveNext, and MoveLast.
These variables are only maintained when the CDaoRecordView::OnMove method
is invoked. This method invokes the CDaoRecordset MoveFirst, MoveNext,
MovePrevious, or MoveLast methods, and updates the variables. Only OnMove
keeps these variables in synchronization.The following list contains the more common CDaoRecordset methods that change the current record:
When the AddNew method is called, a new record is added to the recordset
but the current record bookmark does not change. To change the newly added
record to the current record, use the following method:
NOTE: GetLastModifiedBookmark() needs to be called right after the call to
Update() to return the newly added record. Calling it after one of the
recordview MoveXXXX functions returns a bookmark to the record that was
current prior to the move operation.
RESOLUTIONAfter performing a CDaoRecordset method for an instance utilized by CDaoRecordView, reset the CDaoRecordView's bookkeeping variables as shown in the following code:
STATUSThis behavior is by design. MORE INFORMATIONSteps to Reproduce Behavior
REFERENCESFor additional information, please see the following articles in the Microsoft Knowledge Base: Q145686 CDaoRecordView Bookmark Members Invalid After Requery() Q145719 DAOENROL - Can't See Added Records in Windows 95 Additional query words:
Keywords : kbcode kbusage kbDAO kbDatabase kbMFC kbVC kbVC400 kbVC410 kbVC420 kbVC500 kbVC600 |
Last Reviewed: July 30, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |