Reputation: 559
How to use encryption to SQLite DB in Delphi if i'm using SQLite ODBC Driver.
I must use ADO components for data access.
Upvotes: 5
Views: 2122
Reputation: 7750
As I see from ODBC driver source, one of the 2 options:
WITH_SQLITE_DLLS
defined, so it will use sqlite3.dll. Then provide sqlite3.dll compiled with SQLITE_HAS_CODEC
.SQLITE_HAS_CODEC
defined. Then link SQLite engine statically with ODBC driver.SQLITE_HAS_CODEC
means, that SQLite engine is compiled with build-in codec. By default SQLite has no codec. You can use SQLCipher instead of standard SQLite. Or obtain SQLite with Encryption Extension.
Then to connect to encrypted database using ODBC you will need to specify PWD=xxx
in connection string.
Upvotes: 6