Open isocollection opened 7 years ago
Same problem updating password. Why is this issue submitted in Apr, and now in Oct it still has no reply?
Sorry for no reply for such a long time.
I think you misunderstand connectOptions
. connectOptions
should be set before QSqlDatabase::open()
. You could think it is the options for connecting (opening) the database. So your code will not work because you set connectOptions
after opening the database. Please check the following code:
QSqlDatabase dbconn = QSqlDatabase::addDatabase("SQLITECIPHER");
dbconn.setDatabaseName("test_c.db");
dbconn.setPassword("test");
dbconn.setConnectOptions("QSQLITE_UPDATE_KEY=newtest");
if (!dbconn.open()) {
qDebug() << "Can not open Db!" << dbconn.lastError().driverText();
} else {
qDebug() << "Password changed";
}
dbconn.close();
My code is:
Password update is not working. I can not change my db password. How Can I fix it?