I am working on a database using DAORecordsets. Part of the requirement is to add information to a record about a parameter that may be passed when the program is executed. (If no parameter is passed, then a blank record is appended and the program behaves as it ought).
I create the recordset, check that I can update, call addnew, enter the data on the form and then call update. Everything appears to do what it should do except that the new record is not added to the database.
When I step through the code, I can see all the values that have been added by the use on the data capture form; I can see those values being copied to the recordset. However, as soon as I call the Update finction, the recordset displays the value for the first record in the database.
The code fragment below demonstrates is cut staright from my app. First the OnInitialUpdate method
okToQuit = TRUE;
newRec = FALSE;
m_pSet = &GetDocument()->m_sACSet;
if (m_pSet->CanUpdate() && newRec)
Then the method to collect the data from the form and update the recordset. (Most of the data retrieval code has been cut out for clarity.)
// Write the record