SetFieldDirty Question
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I am having problem setting a dirty flag to a record (CRecordset). I am adding controls to the interface so that no updating to the database is allowed if the form has already been approved. So I did something like the code below. However, I always get the dialog saying "field is still dirty, do not know why". I am not expecting to see this dialog. m_pSet->Edit(); m_pSet->UpdateData(TRUE); if (m_pSet->IsFieldDirty(NULL)) { If (m_pSet->m_is_approved == "1") { //reset the dirty flag m_pSet->SetFieldDirty(NULL, FALSE); AfxMessageBox("no updating is allowed on an approved application."); if (m_pSet->IsFieldDirty(NULL) ) { AfxMessageBox("field is still dirty, do not know why"); } } } m_pSet->Update(); Elizabeth