TSQLQuery post causes error 'Database is locked' lazarus / 16-Databases ---------------------------------------------------------------------- panoss · 2018-08-08 16:26 I 'm trying to insert a new record with this code: 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   partsperdevice_qry.Append;  partsperdevice_qry.FieldByName('device_id').AsInteger:= 1;  partsperdevice_qry.FieldByName('part_id').AsInteger:=3;  partsperdevice_qry.Post;   At .post I get the error: 'database is locked'. (I delete the db and recreate witn SQL, so if it 's locked it gets 'unlocked' for sure) I guess I 'm doing something wrong? ---------------------------------------------------------------------- mangakissa · 2018-08-08 18:20 I tried to start the engine of my car, but can't ride forward. Thats excatly what you saying So - which database - are you meaning the table or database it self. - SQLdb, ZEOS or another databaseframework - How did you create your DB/table As far as I can tell you is: where is the commit(retaining)? Read the database tutorials (even if it's ZEOS) ---------------------------------------------------------------------- af0815 · 2018-08-08 19:01 And don't use two connection for one DB if you use a desktop DB. ---------------------------------------------------------------------- panoss · 2018-08-08 20:10 Quote from: mangakissa on August 08, 2018, 08:20:33 pmI tried to start the engine of my car, but can't ride forward. Thats excatly what you saying So - which database - are you meaning the table or database it self. - SQLdb, ZEOS or another databaseframework - How did you create your DB/table As far as I can tell you is: where is the commit(retaining)? Read the database tutorials (even if it's ZEOS) Sorry I was in a hurry, that 's why I forgot some basic things. The error is 'Database is locked', so I mean the database. SQLite. I created it with 'DB Browser for SQLite' version 3.10.1. Quote from: af0815 on August 08, 2018, 09:01:48 pmAnd don't use two connection for one DB if you use a desktop DB. I only have one connection. EDIT: I recreated the db with the SQL and this time it worked! No locks anymore! I don' t know what the problem was as I did nothing differently this time... ---------------------------------------------------------------------- egsuh · 2018-08-08 23:16 Once I had similar experience with SQLite3. I don't know why yet. Just guessing that DB Browser for SQLite might have been open at the same time, something like that.