How to use encryption to SQLite DB in Delphi if i'm using SQLite ODBC Driver.
I must use ADO components for data access.
如果我使用的是SQLite ODBC Driver,如何在Delphi中对SQLite DB使用加密。我必须使用ADO组件进行数据访问。
1 个解决方案
#1
6
As I see from ODBC driver source, one of the 2 options:
正如我从ODBC驱动程序源中看到的,有两个选项之一:
- Compile ODBC driver with
WITH_SQLITE_DLLS
defined, so it will use sqlite3.dll. Then provide sqlite3.dll compiled withSQLITE_HAS_CODEC
. - 编译ODBC驱动程序并定义了WITH_SQLITE_DLLS,因此它将使用sqlite3.dll。然后提供使用SQLITE_HAS_CODEC编译的sqlite3.dll。
- Compile ODBC driver and SQLite engine with
SQLITE_HAS_CODEC
defined. Then link SQLite engine statically with ODBC driver. - 使用定义的SQLITE_HAS_CODEC编译ODBC驱动程序和SQLite引擎。然后使用ODBC驱动程序静态链接SQLite引擎。
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.
SQLITE_HAS_CODEC表示,SQLite引擎是使用内置编解码器编译的。默认情况下,SQLite没有编解码器。您可以使用SQLCipher而不是标准SQLite。或者使用加密扩展获取SQLite。
Then to connect to encrypted database using ODBC you will need to specify PWD=xxx
in connection string.
然后,要使用ODBC连接到加密数据库,您需要在连接字符串中指定PWD = xxx。
#1
6
As I see from ODBC driver source, one of the 2 options:
正如我从ODBC驱动程序源中看到的,有两个选项之一:
- Compile ODBC driver with
WITH_SQLITE_DLLS
defined, so it will use sqlite3.dll. Then provide sqlite3.dll compiled withSQLITE_HAS_CODEC
. - 编译ODBC驱动程序并定义了WITH_SQLITE_DLLS,因此它将使用sqlite3.dll。然后提供使用SQLITE_HAS_CODEC编译的sqlite3.dll。
- Compile ODBC driver and SQLite engine with
SQLITE_HAS_CODEC
defined. Then link SQLite engine statically with ODBC driver. - 使用定义的SQLITE_HAS_CODEC编译ODBC驱动程序和SQLite引擎。然后使用ODBC驱动程序静态链接SQLite引擎。
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.
SQLITE_HAS_CODEC表示,SQLite引擎是使用内置编解码器编译的。默认情况下,SQLite没有编解码器。您可以使用SQLCipher而不是标准SQLite。或者使用加密扩展获取SQLite。
Then to connect to encrypted database using ODBC you will need to specify PWD=xxx
in connection string.
然后,要使用ODBC连接到加密数据库,您需要在连接字符串中指定PWD = xxx。