Page 1 of 1

Close SQLite file

Posted: Tue 28 Aug 2012 10:28
by Roliat
Hello,

in our current project we're using SQLite (for the first time). So we run into a little problem: How can we close the database-file at runtime.

Background: The program connects to this file at startup. In the settings you can delete the database. But the delete-command fails, because UniConnection seems to lock the file or whatever.

We tried a simple

Code: Select all

UniQuery1.Close;
UniConnection1.Disconnect;
UniConnection1.Close;
But the file is still open and not deletable.

How can we close the file?

Thanks in advance

Re: Close SQLite file

Posted: Tue 28 Aug 2012 11:23
by AlexP
hello,

We cannot reproduce the problem, after calling the UniConnection.Disconnect method the database file detaches, and it can be deleted with the help of the DeleteFile standard method.

Code: Select all

  UniConnection1.Disconnect;
  DeleteFile(UniConnection1.Database);
P.S. Please specify your exact version of UniDAC.