SQLite detach database produces database is locked error
Posted: 18.10.2024, 18:28
Hello,
I use attached databases with SQLite on my projects and it works well with Zeosdb 7.0 and 7.1.
But it no longer works with Zeosdb 7.2 and 8.0.
My need is to open a "master" database and attach another detail database among several available. We open only one detail database at a time. It is closed to open another but without closing the "master" database or the datasets linked to it.
To close the detail database, we close all the datasets linked to this database and then use the DETACH DATABASE "detail" instruction.
The DETACH DATABASE instruction causes a locked database error if we have opened more than one table in the "master" database.
Attached is a test program source (include 2 files db3): Use the Open, Attach and Detach buttons in order to get the error.
Note: Compiler is Delphi 10.3
Thank you for your help.
I use attached databases with SQLite on my projects and it works well with Zeosdb 7.0 and 7.1.
But it no longer works with Zeosdb 7.2 and 8.0.
My need is to open a "master" database and attach another detail database among several available. We open only one detail database at a time. It is closed to open another but without closing the "master" database or the datasets linked to it.
To close the detail database, we close all the datasets linked to this database and then use the DETACH DATABASE "detail" instruction.
The DETACH DATABASE instruction causes a locked database error if we have opened more than one table in the "master" database.
Attached is a test program source (include 2 files db3): Use the Open, Attach and Detach buttons in order to get the error.
Note: Compiler is Delphi 10.3
Thank you for your help.