Hi-
I think there must be a better way to do this. I have a zquery, zconnection, grid, and tzupdate control.
It doesn't seem right that the zquery is readonly false. Is there a way to do this where the zquery is readonly - true?
I thought the whole idea behind tzupdate was that a readonly false wasn't allowed with a complicated query from more than one table.
Here is my code which works if it is a simple query and the zquery is readonly false.
Please check out the code and assist! Thanks for any help- jim
procedure TForm1.Button2Click(Sender: TObject);
var
Reply, BoxStyle: Integer;
begin
ZConnection1.Connected:=true;
ZQuery1.Close;
ZQuery1.UpdateObject := ZUpdateSQL1;
ZUpdateSQL1.ModifySQL.text:='update employee set last_name = :ln, first_name =:fn where emp_no =:en';
ZQuery1.Open;
ZQuery1.Append;
//ZQuery1.FieldByName('last_name').Value := 'bar';
//ZQuery1.FieldByName('first_name').Value := '123';
ZUpdateSQL1.Params.ParamByName('fn').AsString:='mrfoo12';
ZUpdateSQL1.Params.ParamByName('ln').AsString:='mrsfoo';
ZUpdateSQL1.Params.ParambyName('en').AsInteger:=2;
ZQuery1.ApplyUpdates;
ZQuery1.CommitUpdates;
ZQuery1.Close;
ZConnection1.Connected:=false;
end;