Recent

Author Topic: SQLite3Connection1: Database is locked  (Read 1132 times)

Jvan

  • Full Member
  • ***
  • Posts: 181
SQLite3Connection1: Database is locked
« on: May 31, 2021, 11:06:02 pm »
I don't have any other software using the sqlite3 database.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button2Click(Sender: TObject);
  2. begin
  3.   SQLQuery2.SQL.Text := 'INSERT INTO test_001 (Campo_001, Campo_002, Campo_003) VALUES (:CAMPO_001, :CAMPO_002, :CAMPO_003);';
  4.   SQLQuery2.ParamByName('CAMPO_001').AsString := Edit1.Text;
  5.   SQLQuery2.ParamByName('CAMPO_002').AsFloat := FloatSpinEditEx1.Value;
  6.   SQLQuery2.ParamByName('CAMPO_003').AsString := Edit2.Text;
  7.  
  8.   Edit3.Text:=SQLQuery2.SQL.Text;
  9.   SQLQuery2.ExecSQL();
  10.   SQLTransaction1.Commit();
  11.  
  12.  
  13. end;
  14.  
« Last Edit: May 31, 2021, 11:07:43 pm by Jvan »

Zvoni

  • Hero Member
  • *****
  • Posts: 627
Re: SQLite3Connection1: Database is locked
« Reply #1 on: June 01, 2021, 08:20:53 am »
Are you using the visual components?
Active in Object-Inspector?

IIRC, it was the same issue for me, and NOT using Object-Inspector to set it to active solved it for me.
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircraft

 

TinyPortal © 2005-2018