Adding records to TSQLQuery lazarus / 16-Databases ---------------------------------------------------------------------- LemonParty · 2024-02-15 13:10 Hi. I am using TSQLQuery with TDBGrid. When I open Query – everything OK, old records are visible. I am doing the next thing: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i begin  Query.Append;  {edit fields here}  Query.Post;end; The code above seems work fine (new records appear in DBGrid). But when I close and open the dataset records added this way disappear. How to make them left? ---------------------------------------------------------------------- TRon · 2024-02-15 13:14 See wiki about transactions. ---------------------------------------------------------------------- LemonParty · 2024-02-15 14:40 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Query.ApplyUpdates;Do the thing. Thank you. ---------------------------------------------------------------------- TRon · 2024-02-15 15:44 Thank you for reporting back LemonParty. Note that I specially mentioned the link in the wiki to get yourself acquainted with transactions as the wiki article explains what a transaction actually does. Now, that might or might not be applicable to your situation f.e. because you are working with a local database but it definitely comes into play when working with a remote database. You can setup your code so that there is no need to (manually) perform transactions but that is usually an undesirable situation for remote servers.