SQLQuery & InsertSQL Problem lazarus / 16-Databases ---------------------------------------------------------------------- antonio.mchelangeli · 2012-03-28 11:20 Hi, in the attachment i post the little program that update a firebird database named prova.fdb with the dbgrid. When i add a new record and press post in the navigator bar the record is added but if i press then refresh button in dbnavigator the record dissolves... why??? Where is the my error???  Sorry for the english i am italian ---------------------------------------------------------------------- BigChimp · 2012-03-28 11:33 Going to have a look. Before that: you know there's a wiki page (SQLDB Tutorial1) with examples? Also a wiki page explaining insertsql etc? Second: what Lazarus version? Operating system? Firebird version? Assuming you're using Firebird embedded here? Note that FreePascal Windows x64 doesn't seem to work well with Firebird embedded... you might want to try with x86/32 bit version. ---------------------------------------------------------------------- BigChimp · 2012-03-28 12:17 Sorry, no time right now... might get back to it.. ---------------------------------------------------------------------- ludob · 2012-03-28 12:53 Whatever you do in the dbgrid is in memory. You need to call ApplyUpdates to send them to the database. If you want every record sent to the database when posted, create an AfterPost event handler for SQLQuery1 and call SQLQuery1.ApplyUpdates. You'll also need to commit the transaction if you want the changes to the database to be permanent. ---------------------------------------------------------------------- Lacak2 · 2012-03-28 12:55 Yes as Ludo wrote. Missing: sqlquery1.ApplyUpdates and SQLTransaction1.Commit[Retaining] See: http://wiki.freepascal.org/SQLdb_Tutorial1#Editing_data_using_the_grid ---------------------------------------------------------------------- antonio.mchelangeli · 2012-03-28 17:42 Quote from: BigChimp on March 28, 2012, 01:33:39 pmGoing to have a look. Before that: you know there's a wiki page (SQLDB Tutorial1) with examples? Also a wiki page explaining insertsql etc? Second: what Lazarus version? Operating system? Firebird version? Assuming you're using Firebird embedded here? Note that FreePascal Windows x64 doesn't seem to work well with Firebird embedded... you might want to try with x86/32 bit version. Lazarus Version : Lazarus 0.9.30.4 Operating system : Windows 7 32 bit Firebird version : Firebird 2.1 server classic Thanx