Using other sqlite3.dll library / FSEE support

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for universal data access
Post Reply
cbc700
Posts: 43
Joined: Fri 03 Aug 2007 17:25

Using other sqlite3.dll library / FSEE support

Post by cbc700 » Fri 13 Apr 2018 09:01

Is it possible to have dotConnect Universal when used with dotConnect for SQLite to use a provided sqlite3.dll library, as can be done in UniDAC?

I'm trying to interface to a freeware SEE-compatible encryption library (shenghe/FreeSQLiteEncryption on Github). The error reported is that it cannot find a API named sqlite3_key in sqlite3.dll. It seems Universal always wants to load the sqlite3.dll that is in the Windows System32 folder, instead of the one in the current app folder. Even with deleting the Windows one, it will still not find a local one.

I was able to use FSEE with SQLite Expert Professional to easily manage encrypted database, so its easy and seamless.

Could we have FSEE officially supported as another encryption option in Universal?

Thanks.

Pinturiccio
Devart Team
Posts: 2254
Joined: Wed 02 Nov 2011 09:44

Re: Using other sqlite3.dll library / FSEE support

Post by Pinturiccio » Tue 17 Apr 2018 13:58

When you install dotConnect Universal, sqlite3.dll is placed to %WinDir%\System32 and %WinDir%\SysWOW64 folders.

Depending on the operating system bitness, dotConnect Universal looks for sqlite3.dll file in following locations:
1. If the operating system bitness is x86, place the x86 sqlite3.dll library to your application folder or to the %WinDir%\System32 folder.
2. If the operating system bitness is x64, place the x64 sqlite3.dll library to the %WinDir%\System32 folder and the x86 sqlite3.dll library to the %WinDir%\SysWOW64 folder or create the 'x64' and 'x86' folders in your application folder and place the corresponding libraries to them.
cbc700 wrote:It seems Universal always wants to load the sqlite3.dll that is in the Windows System32 folder
You can create the 'x64' and 'x86' folders in the folder of your application and place the sqlite3.dll libraries of the corresponding bitness to these folders. sqlite3.dll can be found in the following folders:
- C:\Program Files (x86)\Devart\dotConnect\Universal\Providers\sqlite3.dll - x86 library;
- C:\Program Files (x86)\Devart\dotConnect\Universal\Providers\x64\sqlite3.dll - x64 library.
Our provider first looks for the sqlite3.dll library in the local folder, and then - in the System32 or SysWOW64 folder.

If you want to use a custom sqlite3.dll library with some extension, this library must also be named sqlite3.dll and have the same interface.

Please note that dotConnect Universal uses common ADO.NET features and does not use specific features of the providers. For example UniConnection does not have the ChangePassword method and you won't be able to change a password or encrypt an unencrypted database with SEE encryption in dotConnect Universal. For this you need to use dotConnect for SQLite. However, you can specify in connection string needed parameters to connect to SEE database with dotConnect Universal and connect and work with SEE database.

dotConnect for SQLite (and dotConnect Universal) supports the following kinds of encryption: SEE, CEROD, SQLiteCrypt and SQLCipher. FSEE is not supported; however, if its engine has the same interface as the engine of the SEE extension, it may prove working. But you have to use the respective SQLite extension. For more information, please refer to http://www.devart.com/dotconnect/sqlite ... nMode.html

For working with FSEE, you need to specify "Encryption=SEE" in SQLiteConnection or UniConnection connection string and specify a value to the Password connection string parameter.

cbc700
Posts: 43
Joined: Fri 03 Aug 2007 17:25

Re: Using other sqlite3.dll library / FSEE support

Post by cbc700 » Sat 26 May 2018 19:48

Thanks very much for that detailed explanation. Once I applied your notes, all is well. I used an "x86" subfolder (from app location) containing the FSEE sqlite3.dll file, and a connect string similar to this...

Provider=SQLite; DataSource=C:\Temp\Database.db; Encryption=SEE; Password=aa

Works perfectly. Seems FSEE is a viable free option for encryption with dotConnect.

Thanks again!

Post Reply