I am trying to save data to postgres from tedit the code I am using is this:
procedure TForm1.Button3Click(Sender: TObject);
begin
ZQuery1.Close;
ZQuery1.SQL.Clear;
ZQuery1.SQL.Add('insert into tdatostag (dirtag,valortagint,valortagnum,nombretag,tipodato)');
ZQuery1.SQL.Add('values (:dirtag,:valortagint,:valortagnum,:nombretag,:tipodato)');
ZQuery1.Params.ParamByName('dirtag').AsString:=Edit1.Text;
ZQuery1.Params.ParamByName('valortagint').AsString:=Edit2.Text;
ZQuery1.Params.ParamByName('valortagnum').AsString:=Edit3.Text;
ZQuery1.Params.ParamByName('nombretag').AsString:=Edit4.Text;
ZQuery1.Params.ParamByName('tipodato').AsString:=Edit5.Text;
ZQuery1.ExecSQL;
ZQuery1.Open;
end;
When compiling it does not give me any error, but when I press on the save button it gives me error:
The project has thrown an exception 'EZDatabaseError' with the message: Can not open a Resulset.
Structure of table.
dirtag int4 not null
valortagint int4 not null
valortagnum numeric not null
nombretag bpchar not null
tipodato bpchar not null
Thank you very much for your kind attention.
Regards.