Article ID: 191737
Article Last Modified on 2/12/2007
static CDaoDatabase mdb; //** Add db class here or in .h file.
mdb.Open("D:\\RO.mdb",TRUE,TRUE); //** RO && Exclusive
m_pSet->m_pDatabase= &mdb; //** Assign DB to RecordSet class.
Even though you must open the .mdb file with exclusive access, other
applications can also open it read-only and exclusive.
void CCDRomView::OnInitialUpdate(){
m_pSet = &GetDocument()->m_rOSet; // Original wizard code.
#ifdef FixCode
//** Add db class here or in .h file.
static CDaoDatabase mdb;
//** Open it ReadOnly and Exclusive.
mdb.Open("D:\\RO.mdb",TRUE,TRUE);
//** Assign DB to RecordSet class.
m_pSet->m_pDatabase= &mdb;
#endif
CDaoRecordView::OnInitialUpdate(); // original wizard code
}
Keywords: kbdatabase kberrmsg kbprb KB191737