sqlite3 error: file is encrypted or is not a database

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
skippy
Posts: 20
Joined: Fri 18 Sep 2009 09:42

sqlite3 error: file is encrypted or is not a database

Post by skippy » Tue 05 Jan 2016 16:16

Hi,

I'm using UniDac 4.38 and user TUniConnection, TSQLiteUniProvider and TUniScript to create SQLite3 Database. Everything works fine, but when I try to use it in a SQLite client, I get the above error. I don't have any encryption on the db, but I heard that could be a version mismatch in SQLite. I presume that UniDac is creating SQLite3 db and not SQLIte2.

Any idea ?
Thanks

-------------------------------
I use the folowing code:

procedure Tdmod.CreateDB(AName: string);
begin
CloseDB;
// ---
Connection.SpecificOptions.Values['ForceCreateDatabase'] := 'True';
connection.Database := AName;
UniScript1.Execute;
end;

-------------- script: -----------------
DROP TABLE IF EXISTS "APP";

CREATE TABLE "APP" (
Name VARCHAR(30) PRIMARY KEY NOT NULL,
Prod CHAR(10),
Desc MEMO
);

DROP TABLE IF EXISTS "FIELD";

CREATE TABLE "FIELD" (
Name VARCHAR(30),
APP VARCHAR(30),
Desc MEMO
);

CREATE UNIQUE INDEX IDX_FieldApp ON Field (Name,App);

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: sqlite3 error: file is encrypted or is not a database

Post by MaximG » Fri 08 Jan 2016 12:36

UniDAC only supports the SQLite3 format

skippy
Posts: 20
Joined: Fri 18 Sep 2009 09:42

Re: sqlite3 error: file is encrypted or is not a database

Post by skippy » Mon 11 Jan 2016 08:37

Yes that was my assumption, but why do I get this error then ?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: sqlite3 error: file is encrypted or is not a database

Post by MaximG » Mon 11 Jan 2016 13:46

The "file is encrypted or is not a database" error may occur in case if the application connects to the SQLite database using a client library of a version incompatible with the one, that was used when creating the database. Please make sure your application uses the same sqlite3.dll library version, that was used when creating the SQLite database.

Post Reply