Inserting new records lazarus / 16-Databases ---------------------------------------------------------------------- perhen · 2014-06-03 22:37 Hello I am trying to use a SQL base, I have tried MySQL and Firebird, but I have the same problem. I can see the records in a table, but I am not able to insert new records. I have tryed in the object inspector to set SQLQuery1.SQL equal to insert into person (nr, navn) values (:P1, :P2) and a button with this code: procedure TForm1.Button1Click(Sender: TObject); begin   SQLQueryNy.Close;   SQLQueryNy.ParamByName('P1').AsString := Edit1.text;   SQLQueryNy.ParamByName('P2').AsString := Edit2.text;   SQLQueryNy.ExecSQL; end;    Is it possibly anyone that can tell me why new records are not saved. perhen ---------------------------------------------------------------------- fpcoder · 2014-06-04 01:40 You probably just need to commit the data to the database: Code: [Select]SQLQueryNy.ExecSQL; MyTransaction.Commit; SQLQueryNy.Open; or Code: [Select]SQLQueryNy.ExecSQL; MyTransaction.CommitRetaining; SQLQueryNy.Refresh; ---------------------------------------------------------------------- perhen · 2014-06-04 06:34 Thanks!