[SOLVED} Proper method to use lazarus / 16-Databases ---------------------------------------------------------------------- dodgebros · 2023-10-23 16:35 Is this the proper way to code using these components, in particular do I need to set DataModule1.SQLTransPlsizes.Active equal false after a commit?  SQLTransPlsizes is a TSQLTransaction component from the SQLdb tab. TD Code: [Select]  DataModule1.SQLQryPlsizes.SQL.Text := "SELECT * FROM tblPlsizes";   DataModule1.SQLTransPlsizes.Active := true;   DataModule1.SQLQryPlsizes.ExecSQL;   DataModule1.SQLTransPlsizes.Commit;   DataModule1.SQLTransPlsizes.Active := false; ---------------------------------------------------------------------- cdbc · 2023-10-24 06:18 Hi TMK, "DataModule1.SQLTransPlsizes.Commit;" aswell as "DataModule1.SQLTransPlsizes.Rollback;" ends the transaction started with "DataModule1.SQLTransPlsizes.Active := true;" So there's NO need for this: "DataModule1.SQLTransPlsizes.Active := false;" HTH Regards Benny ---------------------------------------------------------------------- Leledumbo · 2023-10-24 06:23 Quote from: dodgebros on October 23, 2023, 06:35:58 pmin particular do I need to set DataModule1.SQLTransPlsizes.Active equal false after a commit? No, Commit will deactivate it as well. CommitRetaining is available if you want to keep the transaction open. I suggest reading SqlDBHowto to clear the confusion about how the various DB components work together, such as when StartTransaction is required to be explicitly called and when it's not. ---------------------------------------------------------------------- dodgebros · 2023-10-24 15:11 Thanks for thee reply's, I will indeed read the SqlDBHowTo. TD