How to Open an Encrypted SQLite db via SQLDatabaseMBS?

I have a project that creates an encrypted SQLite database using a Xojo SQLiteDatabase object. I can open, read, write and close it OK. Now I want to open it using SQLDatabaseMBS’ ability to open SQLite databases. My problem is that the .Connect always fails.

First I set to the correct password for encryption:

tempSQLDatabaseMBS.Password = "my password"

Then I set:

tempSQLDatabaseMBS.DatabaseName = "sqlite:" + SQLiteFolderItem.ShellPath

Once I have done this the following line fails:


Is there something I’m missing? Do I need to place the password in the DataBaseName?

Separately, I am not sure now to specify the SQLite pathname if it contains spaces. I have tried using NativePath and ShellPath without success, even if inside double-quotes.

P.S. I can open non-encrypted SQLite databases using SQLDatabaseMBS just fine.

Unless the sqlite plugin Christian has also includes the SQLite encryption code from Dr Hipp then it won’t be openable using the MBS plugin.
This is true for any other tools.
They MUST use that code which is licensed (or code that clones what Dr Hipp has done for encryption)

the password doesn’t go in the password field.

First you need a sqlite library including the encryption you need.
(and there are several available on the internet)

Second you use a SQLExecute with a pragma to tell library the password.
Than you can read/Write to database.

see also

I did this for SQLCipher, but it should work similar for others.

Anyone distributing a dylib with Dr Hipps code in it is breaking their license

Thank you to all…