Firebird v2.5.3 and Lazarus v.1.2.6 and FPC v.2.6.4 on Win7X64
I have a single table in Firebird that I am accessing with a TIBConnection, TSQLTranaction, TSQLQuery, TDataSource, TDBGrid, and TDBNavigation. Three buttons have the code as below to Update, Save and Delete the table. If I use the Delete button to delete an entry, all is fine. After that when I use the save button to save the new database, I get a message "Project myproject raised exception class 'EDatabaseError' with message: SQLQuery1: no delete query specified and failed to generate one. (No fields for inclusion in where statement found)." The same is the case when I use the TDBNavigation Delete button: all is fine until I use the save button, which generates the same error message. Does anyone have any idea?
Thanks, Jeroen
procedure TForm1.Button1Click(Sender: TObject);
begin
SQLQuery1.ApplyUpdates;
SQLQuery1.Refresh;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
SQLQuery1.Edit;
SQLQuery1.UpdateMode:=UpWhereChanged;
SQLQuery1.ApplyUpdates;
SQLTransaction1.Commit;
SQLQuery1.Close;
SQLQuery1.Open;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
DBGrid1.DataSource.DataSet.Delete;
end;