SQLCipher on Delphi?

Hi, I am trying to use SQLCipher on Delphi 11. I am making some progress… but can’t get the PRAGMA cipher_license command to work… I must be missing something fundamental?

From Delphi I can link to the sqlcipher.dll (32 bit) with linking commands like this:

function SQLite3_Open(filename: PAnsiChar; var db: TSQLiteDB): integer; cdecl; external SQLiteDLL name ‘sqlite3_open’;
function SQLite3_Open16(filename: PChar; var db: TSQLiteDB): integer; cdecl; external SQLiteDLL name ‘sqlite3_open16’;
function SQLite3_Key(db: TSQLiteDB; pKey: pChar; nKey: Integer): integer; cdecl; external SQLiteDLL name ‘sqlite3_key’;
function SQLite3_Close(db: TSQLiteDB): integer; cdecl; external SQLiteDLL name ‘sqlite3_close’;

Calling sqlite3_open works ok, and calling sqlite3_key works ok.

However, if I try to execute the PRAGMA command to apply the license it always errors:

license := QuotedStr(’<redacted>’);
SQL := 'PRAGMA cipher_license = ’ + license + ‘;’;
iResult := sqlite3_exec(self.fDB, pAnsichar(SQL), nil, nil, errorMessage);

The iResult is never 0, and the errorMessage is some spurious characters.

Any help appreciated.

Hello @Splinter

We just replied to your message via private support. Would you mind taking a look at our additional questions and get back to us via our support email address when you get the opportunity? Thanks!