Detect deleted records

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mohamad
Posts: 4
Joined: Sun 18 Dec 2011 09:52

Detect deleted records

Post by mohamad » Tue 25 Feb 2014 16:21

How do I detect deleted record when dataset(TMSQuery) in CachedUpdates mode?
Is it possible to identify the attributes(fields) deleted records?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Detect deleted records

Post by AlexP » Wed 26 Feb 2014 13:11

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;

Post Reply