Home > Back-end >  TADODataSet delete rows, the bank why disappear, not status to usDeleted
TADODataSet delete rows, the bank why disappear, not status to usDeleted

Time:09-28

To do operation log, a table in a DBGRID operation, using ltBatchOptimistic bulk mode,
Now you can get new, modified, but not delete
Procedure TForm1. BitBtn3Click (Sender: TObject);
The begin
Memo1. Lines. The clear;
With clientdataset1 do
The begin
////////////////////
StatusFilter:=[usModified, usInserted usDeleted];
Filtered:=True;
While not eof do
The begin
Case UpdateStatus of
UsModified: Memo1. Lines. The Add (' change: '+ vartostr (fields. [0] oldvalue) +'=& gt; '+ fields [0]. Asstring) are identical;
UsInserted: Memo1. Lines. The Add (+ fields' added: '[0]. Asstring) are identical.
UsDeleted: Memo1. Lines. The Add (' delete: + vartostr (fields. [0] oldvalue));
The end;
next;
The end;
StatusFilter:=[];
The end;
The end;

Of course there is a people with clientdataset1, my side is TADODataSet. Excuse me everybody, TADODataSet what should be done?

CodePudding user response:

Clientdataset and TADODataSet. The usage of different, its status value is also different, specific as follows:
TDataSetState=(dsInactive, dsBrowse dsEdit, dsInsert, dsSetKey,
DsCalcFields dsFilter, dsNewValue dsOldValue, dsCurValue, dsBlockRead,
DsInternalCalc dsOpening);
  • Related