Opening Encrypted Sqlite gives Error 26

I have created a AES128 encrypted sqlite database. I created it using SQLLiteManager. It created it and I can close it and open it again. It asks for password and it opens it up.

When I try opening it with this code, I get an error 26.

db = new SQLiteDatabase

Var dbFile As FolderItem = SpecialFolder.Desktop.Child(“PK.kno”)

If dbFile <> Nil And dbFile.Exists Then
db.DatabaseFile = dbFile
db.EncryptionKey = “Yek4%8_fi6”

Try
db.Connect
'MessageBox(“Connected to database successfully!”)
Catch error As DatabaseException
MessageBox("DB Connection Error: " + error.Message)
End Try
End If

The file must exist or else it would do nothing.

Might be something stupid, but just not sure.

Alan

Make it unencrypted using your tools. Encrypt it using Xojo.

You may want to create a tool in Xojo to encrypt/decrypt DBs.

Would you mind showing me the code to encrypt in Xojo?
I haven’t used Xojo in about 10 years, and just getting back into it.
Haven’t ever encrypted a database, but I need it for this.
If you don’t mind too much…
Alan

Use the Encrypt method.

1 Like

A little background, sqlite provides 2 encryption methods. Xojo uses one of them and it sounds like your tools are using the other.

I thought sqllitemanager would have used the same as xojo. When i picked aes128 it said it was compatible with xojo and cubesql.

I will try encrypt function tomorrow and see what I xan do.

Thanks everyone

You should also try specifying the encryption type by prefixing the password with “aes128:”