SQLQuery1.ApplyUpdates lazarus / 16-Databases ---------------------------------------------------------------------- DarkSagara · 2006-06-21 15:48 Hi, i have an problem with connect lazarus(0.9.16) + firebird(1.5), i am using  this components: + IBConnection (SQLDB) + SQLTransaction (SQLDB) + SQLQuery (SQLDB) + DataSource (Data Access) + DBGrid (Data Controls) + DBNavigator (Data Controls) I see the content of tables, but the changes only in cache, how i can solve this problem ? how i can make changes in the database file ? Thanks =] ---------------------------------------------------------------------- RudieD · 2006-06-21 17:36 I think you should call SQLTransaction.Commit ? ---------------------------------------------------------------------- Anonymous · 2006-06-21 17:53 first thanks for the reply... =] i have in my project 2 dbedits and 4 buttons, my code: + button1.onclick:    sqlquery1.insert; + button2.onclick:    sqlquery1.delete;    sqlquery1.applyupdates;   + button3.onclick:    sqlquery1.post;    sqlquery1.applyupdates; + button4.onclick:    sqlquery1.cancel; with this code, i can change the database but only in memory, the database file in hd, is not affected... when a close the program e open again, the database is clear, how i can solve this ? ---------------------------------------------------------------------- Anonymous · 2006-06-21 22:43 sqltransaction.Commit; I think RudieD made the above suggestion. John ---------------------------------------------------------------------- JJurado · 2006-08-02 08:42 Hi! I have the same problem. The only way I found was doing and SQL UPDATE statement when the data changes. But I don't know if there are another better solution. The SQLTransaction.commit doesn't work ---------------------------------------------------------------------- MT · 2007-01-06 22:30 Hi. I have same problem. My project has two forms. I use same code in form1 and form2 for different tables.  but in form2 when I try SQLQuery1.ApplyUpdates mysql server returns a syntax error. I use DBEdits and I post changes with button because of DBNavigator bug. Here is the my post code in form1 and form2: Code: [Select]procedure TForm2.Button7Click(Sender: TObject); begin SQLQuery1.Post; SQLQuery1.ApplyUpdates; SQLTransaction1.Commit; end; Error: "An error occured while applying the updates in a record: MySQL50Connection1: Error executing query: You have an error in your SQL syntax; check the manual corressponds to your MySQL server version for the right syntax use near " at line1." How can I solve this problem? ---------------------------------------------------------------------- JanH · 2007-01-10 14:40 I prefer to write a global unit, which only "talk" with the DB. ;-)