changes on the form not in the database lazarus / 16-Databases ---------------------------------------------------------------------- Kristen · 2014-06-19 19:07 Hello, I'm a newbie trying to learn about Lazarus and databases. A small example prog I found on the net works allright, except that changes made on the form when the prog is running don't alter the tables in the data base. I use 1  TDataSource, 1 TDBGrid, 1 TDBNavigator, 1  MySQL55Connection, 1  TSQLQuery & 1 TSQLTransaction. I've got this too : procedure TForm1.SQLQuery1AfterDelete(DataSet: TDataSet); begin   SQLQuery1.ApplyUpdates (); end; procedure TForm1.SQLQuery1AfterPost(DataSet: TDataSet); begin     SQLQuery1.ApplyUpdates (); end;  It _seems _ to work allright  when I use the navigator for deleting, adding or editing, but if I close and reopen the program, nothing has changed. I've got a warning concerning TDataset not being used when compiling, but I don't know what else Ishould pass to the AfterDelete or AfterPost procs. Thanks for reading ! ---------------------------------------------------------------------- Mike.Cornflake · 2014-06-19 19:37 Something changed somewhere recently.  Changes to a DB all occur in a Transaction.  I'll be honest, I normally work in read only databases, so I'm vague on the whole transaction thingy - particularly as they apply to SQLDB, but I suspect that if you add a TSQLTransation.Commit somewhere in your code you'll be fine. From what I do know of transactions, I consider them a necessary evil.  I'd put your .Commit as early as you possibly can.  I don't know about MySQL, but MS SQL will lock any table for other users if it's used in a transaction. ---------------------------------------------------------------------- Kristen · 2014-06-19 19:52 Thanks a million, Mike ! That was a quick one ! You put me on the right track : I changed the TSQLTransaction's action property from caRollback to caCommit and that was it ! Thanks again