Page 1 of 1

TMSUpdateSQL Query property missing

Posted: Fri 10 Feb 2006 14:25
by jfpicard
Please check this sample code.
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;
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.

In this case, the Query property of the TUpdateSQL is very usefull. Is there any work around ?

Thanks for a fast reply.

Posted: Mon 13 Feb 2006 13:45
by Ikar
SDAC doesn't provide such functionality.