Page 1 of 1

Detect deleted records

Posted: Tue 25 Feb 2014 16:21
by mohamad
How do I detect deleted record when dataset(TMSQuery) in CachedUpdates mode?
Is it possible to identify the attributes(fields) deleted records?

Re: Detect deleted records

Posted: Wed 26 Feb 2014 13:11
by AlexP
Hello,

To define the deleted record in the CachedUpdates mode, you can use the UpdateRecordTypes and UpdateStatus properties, for example:

Code: Select all

  MSQuery1.Delete;
  MSQuery1.UpdateRecordTypes := [rtDeleted, rtUnmodified];
  MSQuery1.First;
  while not MSQuery1.Eof do begin
    if MSQuery1.UpdateStatus = usDeleted then
      ShowMessage('Deleted');
    MSQuery1.Next;
  end;