Hi,
I am new to SQLCipher. I am using the Community Edition, version 4.5.2. My Platform is Windows 10.
I followed the instructions to create the encrypted db from scratch as following steps:
1, .\sqlcipher.exe test
2, PRAGMA key = ‘test123’;
3, create table XX
Then I want to insert data into the db using C++ with the APIs. My program is like the following:
int init()
{
int ret = sqlite3_open_v2(“test.db”, &db_, SQLITE_OPEN_READWRITE, NULL);
…
const char* db_key = “test123”;
ret = sqlite3_key(db_, db_key, strlen(db_key));
…
return 0;
}
After opened the db, I try the code to insert data in another function.
int store()
{
sqlite3_stmt *stmt = NULL;
int rc = sqlite3_prepare_v2(db_, “insert into XX”, -1, &stmt, NULL);
…
}
But sqlite3_prepare_v2 return 1, and the sqlite3_errmsg is “no such table”.
The shown codes work on a normal db without encryption.
Could you give me some instructions about my problem?
Thanks.