TMSUpdateSQL Query property missing
Posted: Fri 10 Feb 2006 14:25
Please check this sample code.
In this case, the Query property of the TUpdateSQL is very usefull. Is there any work around ?
Thanks for a fast reply.
I can't run this code with your components because Query[ukInsert] doesn't exist and I can put in on a 'BeforeUpdateExecute' event because I can't change the StatementTypes parameter and I can't say that the 'Update has been completed.procedure TdtmFicheTech.qryFicheTechEquipGrpUpdateRecord(DataSet: TDataSet;
UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction);
var
IdEquipGrp: string;
Action: TUpdateKind;
ApplyAction: Boolean;
Options: TLocateOptions;
begin
Action := UpdateKind;
ApplyAction := True;
usqlFicheTechEquipGrp.SetParams(ukInsert);
IdEquipGrp := usqlFicheTechEquipGrp.Query[ukInsert].ParamByName('IdEquipGrp').AsString;
if qryFicheTechEquipGrp.Locate('IdEquipGrp', IdEquipGrp, Options) then
begin
if (qryFicheTechEquipGrpNewItem.AsInteger = 0) then
if (qryFicheTechEquipGrpDescSousGroupe.AsString = '')
or (qryFicheTechEquipGrpValeur.AsString = '') then
Action := ukDelete
else
else
begin
Action := ukInsert;
if (qryFicheTechEquipGrpValeur.AsString = '') then
ApplyAction := False;
end;
if ApplyAction then
usqlFicheTechEquipGrp.Apply(Action);
end;
UpdateAction := uaApplied;
end;
In this case, the Query property of the TUpdateSQL is very usefull. Is there any work around ?
Thanks for a fast reply.