Error trying to retrieve SQLite version lazarus / 16-Databases ---------------------------------------------------------------------- dietmar · 2021-09-06 14:25 Hello, I am trying to determine the SQLite Version, and I get the error "SQLite3Connection: Database connect string (DatabaseName) not filled in". I can't find the error since I set up a name (and even hardcoding it didn't help). Anyone finds the error? Thx, --Dietmar 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   with SQLite3Connection do begin    DatabaseName := 'bla.db';    Open;    Connected := True;  end;  SQLTransaction.Active := True;  with SQLQuery.SQL do begin    Clear;    Add('select sqlite_version()')  end;  SQLQuery.Open;  stSQLiteVersion.Caption := 'SQLite v' + SQLQuery.FieldByName('sqlite_version()').AsString; ---------------------------------------------------------------------- balazsszekely · 2021-09-06 15:22 Hi dietmar, QuoteI am trying to determine the SQLite Version, and I get the error "SQLite3Connection: Database connect string (DatabaseName) not filled in". I can't find the error since I set up a name (and even hardcoding it didn't help). Anyone finds the error? You did not assign a connection to SQLQuery via the Database property. The following code works fine at my side: 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   SQLite3Connection.HostName := 'locahost';  SQLite3Connection.DatabaseName := ExtractFilePath(Application.Exename) + 'test.db';  //<-change the db name here  SQLite3Connection.Open;  if SQLite3Connection.Connected then  begin    SQLTransaction.DataBase := SQLite3Connection;    SQLTransaction.Active := True;     SQLQuery.DataBase := SQLite3Connection;    SQLQuery.Transaction := SQLTransaction;    with SQLQuery.SQL do begin       Clear;       Add('select sqlite_version()')     end;     SQLQuery.Open;     if not SQLQuery.IsEmpty then       ShowMessage('SQLite v' + SQLQuery.FieldByName('sqlite_version()').AsString);  end; The returned version is: 3.36.0 ---------------------------------------------------------------------- dietmar · 2021-09-06 16:06 Wierd - I have set the connections between the 3 SQLite elements hardcoded via the object inspector. But I just tried your code and get the same error!?! For me, it seems as if there is a problem with DatabaseNAME, but I cannot resolve it --Dietmar ---------------------------------------------------------------------- balazsszekely · 2021-09-06 16:25 Quote from: dietmar on September 06, 2021, 06:06:20 pmWierd - I have set the connections between the 3 SQLite elements hardcoded via the object inspector. But I just tried your code and get the same error!?! For me, it seems as if there is a problem with DatabaseNAME, but I cannot resolve it --Dietmar Please test attached project. After you extract the archive, copy the appropriate(32/64 bit) sqlite3.dll into the project folder. According to your description "Lazarus 2.2.0RC1 with FPC 3.2.2 on Windows10 64Bit", you should download the 64 bit version. PS: I tested both with 32/64 bit versions(Lazarus 2.0.12/Trunk, FPC 3.2.2). Works fine with every combination. ---------------------------------------------------------------------- dietmar · 2021-09-06 18:31 Thanks for your effort! But I don't get it. Although running on Win10 64Bit, with Lazarus 32Bit, loading the 64Bit-SQLite.dll gives error "file not found" or something like that. When using the 32 bit version, your test app works perfectly. I compared your code line after line with my own - no difference. But my code doesn't work either ( --Dietmar ---------------------------------------------------------------------- balazsszekely · 2021-09-06 18:44 QuoteAlthough running on Win10 64Bit, with Lazarus 32Bit, loading the 64Bit-SQLite.dll gives error "file not found" or something like that.Sorry, I should have been more specific: the SQLite bitness must mach Lazarus/FPC bitness. For some reason I assumed that you are using 64 bit Lazarus on Win10 64bit, which is clearly not the case. QuoteI compared your code line after line with my own - no difference. But my code doesn't work either.Can you please attach your project? ---------------------------------------------------------------------- avra · 2021-09-07 00:22 Quote from: dietmar on September 06, 2021, 06:06:20 pmWierd - I have set the connections between the 3 SQLite elements hardcoded via the object inspector.Maybe your application can not open SQLite because IDE already opened it in single threaded mode? Can you close IDE connection and try again? Just in case, read https://sqlite.org/threadsafe.html. ---------------------------------------------------------------------- dietmar · 2021-09-07 16:33 Hi, after cursing a lot while playing half the night with this issue, finally what did the trick was: * closing the IDE * deleting the "backup" and "lib" subdirectories of the project * starting the IDE again * building my project I don't know what the reason was (perhaps a non-printable character in the DatabaseName?) but it's very annoying since this is the 3rd time I can only get rid of an error by performing the steps above. Nevertheless, guys, thanks a lot for your help! --Dietmar