ConflictTable Property Example (VC++)

This example shows how to use the ConflictTable property to resolve update conflicts.

void ResolveConflict( CdbDatabase& dbs )
{
CdbTableDef         tdfTest;
CdbRecordset      rstConflict;
CString            strTable;
long            lCt, lMaxCt;
//
lMaxCt = dbs.TableDefs.GetCount();
for (lCt = 0; lCt < lMaxCt; lCt++)
   {
   tdfTest = dbs.TableDefs[lCt];
   strTable = tdfTest.GetConflictTable();
   if(!strTable.IsEmpty())
      {
      rstConflict = dbs.OpenRecordset(
                     (LPCTSTR)strTable));
      // Process each record
      rstConflict.MoveFirst();
      while (!rstConflict.GetEOF())
         {
         // Do conflict resolution.
         // Remove conflicting record when finished.
         rstConflict.Delete();
         rstConflict.MoveNext();
         }
      rstConflict.Close();
      }
   }
}