The Apply method for an update component manually applies updates for the current record. There are two steps involved in this process:
procedure TForm1.BDEClientDataSet1BeforeUpdateRecord(Sender: TObject; SourceDS: TDataSet; DeltaDS: TCustomClientDataSet; UpdateKind: TUpdateKind; var Applied: Boolean); begin with UpdateSQL1 do begin DataSet := DeltaDS; DatabaseName := (SourceDS as TDBDataSet).DatabaseName; SessionName := (SourceDS as TDBDataSet).SessionName; Apply(UpdateKind); Applied := True; end; end;
void __fastcall TForm1::BDEClientDataSet1BeforeUpdateRecord(TObject *Sender, TDataSet *SourceDS, TCustomClientDataSet *DeltaDS, TUpdateKind UpdateKind, bool &Applied) { UpdateSQL1->DataSet = DeltaDS; TDBDataSet *pSrcDS = dynamic_cast<TDBDataSet *>(SourceDS); UpdateSQL1->DatabaseName = pSrcDS->DatabaseName; UpdateSQL1->SessionName = pSrcDS->SessionName; UpdateSQL1->Apply(UpdateKind); Applied = true; }
Executing an Update Statement
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|