sqrly
October 8th, 1999, 03:24 PM
I have a recordset and recordview and MFC made a nice menu set and toolbar that can step through the records. I need to add to it.
I have another thread that is adding records to the database in the background. I need these buttons to have access to the new records. By default they only "reach" what was in the database when the app started.
I added a message handler for pressing the "moveFirst" button. By default, CW wanted to put it in the CMainFrame class, but that doesn't have access to a ptr to the set. I put the handler in CMyRecordView. It gets called. To get it to actually go to the first, I put:
void CFfSampleView::OnRecordFirst() // Inherits fromCRecordView
{
// TODO: Add your command handler code here
AfxMessageBox("CFfSampleView::OnRecordFirst() fired");
//m_pSet->Requery();
//m_pSet->MoveFirst();
OnMove(ID_RECORD_FIRST);
}
This give me the old functionality, but the requery() breaks it. How else can I get the new records into the recordset?
Thanks
I have another thread that is adding records to the database in the background. I need these buttons to have access to the new records. By default they only "reach" what was in the database when the app started.
I added a message handler for pressing the "moveFirst" button. By default, CW wanted to put it in the CMainFrame class, but that doesn't have access to a ptr to the set. I put the handler in CMyRecordView. It gets called. To get it to actually go to the first, I put:
void CFfSampleView::OnRecordFirst() // Inherits fromCRecordView
{
// TODO: Add your command handler code here
AfxMessageBox("CFfSampleView::OnRecordFirst() fired");
//m_pSet->Requery();
//m_pSet->MoveFirst();
OnMove(ID_RECORD_FIRST);
}
This give me the old functionality, but the requery() breaks it. How else can I get the new records into the recordset?
Thanks