Is there an ability to prevent a record from being written to the database whenever a row is updated or inserted in the database?
You should override OnFlushRecord. OnFlushRecord is called whenever a record should be updated or added to the recordset.
By overriding OnFlushRecord, you can validate all records contents at record level. Objective Grid will always call OnFlushRecord before it tries to position the current cell to a new row.
If the data in the current record are invalid, you should return FALSE. Objective Grid will then abort its current operation and not try to move the record pointer to a new row any more.
Example:
BOOL CMyRecordGrid::OnFlushRecord(ROWCOL nRow, CString* ps)
{
// check if current record is valid
if (!IsValidRecord())
return FALSE;
// else
return CGXDaoGrid::OnFlushRecord(nRow, ps);
}