SQLITE3: How to save data to db-file? lazarus / 16-Databases ---------------------------------------------------------------------- kirchfritz · 2012-06-12 20:53 Hello everybody, I use a SQLite3 db in a dbgrid with datasoure + sqlite3dataset + dbnavigator. Everything works good. The data is shown in the dbgrid and I can use the dbnavigator to scroll through the dbgrid. I even use the dbgrid to edit the data. But when I close my application, the data changes are not written to disk. The db-file is unchanged. Whats wrong in my code? By the way: Sqlite3Dataset.ApplyUpdates is no help! ---------------------------------------------------------------------- goodname · 2012-06-12 22:06 Just a guess but did you remember to commit the transaction after doing ApplyUpdates? ---------------------------------------------------------------------- JanRoza · 2012-06-13 05:58 QuoteWhats wrong in my code?What code? Maybe if you publish the code here people can help you a bit better. ---------------------------------------------------------------------- Knipfty · 2012-06-15 16:49 Hi kirchfritz, How did you get SQLite3 woring in Lazarus?  I have been struggling just to get the comonents to show up in a Lazarus rebuild.  Nay help you provide is greatly appreciated. Thanks ---------------------------------------------------------------------- eny · 2012-06-15 20:04 Quote from: kirchfritz on June 12, 2012, 10:53:34 pmBy the way: Sqlite3Dataset.ApplyUpdates is no help!It's your only help! The last weeks there have been quite a number of SQLite questions and I did a read of the Wiki pages. Although most information to get a working SQLite3 app is in there, it still can be a bit of a puzzle to really get it working. Especially when the navigator component is used. Two ways to get it working: - do an ApplyUpdates on the dataset (this does work, but do it while the dataset is active); - set SaveOnClose to true for the dataset. To be honest I think its a bug that the data is not saved after the OK button on the nav component is clicked. But I never use that component.