QT SQLite with password
Unsolved
General and Desktop
-
wrote on 5 Feb 2018, 16:44 last edited by
Hi, I'm starting with QT SQL. I can't open or create SQLite data base with password. I create the data base and table, but the data base is not protected and I can open whitout password.
Also probe withmdataBase.setPassword("123");
and it does not work.QT SQLite supports password protection?
QSqlDatabase mdataBase; mdataBase = QSqlDatabase::addDatabase("QSQLITE"); mdataBase.setDatabaseName("h:\\bases\\dbasePW.sqlite"); mdataBase.open("","123"); //user name "" / password"123" QString consulta; consulta.append("CREATE TABLE IF NOT EXISTS Persona(" "id INTEGER PRIMARY KEY AUTOINCREMENT," "nombre VARCHAR (100)," "edad INGEGER NOT NULL" ");"); QSqlQuery crear; crear.prepare(consulta); crear.exec();
Thanks Enrique
-
Lifetime Qt Championwrote on 5 Feb 2018, 18:47 last edited by mrjj 2 May 2018, 18:47
Hi
Nope. Not as far as i know.
https://stackoverflow.com/questions/5669905/sqlite-with-encryption-password-protection/5877130#5877130You must encrypt the database or else any tool will just open it.
https://forum.qt.io/topic/37817/using-sqlcipher-in-place-of-sqlite
or alternatively
http://www.qtcentre.org/threads/35148-Building-QSQLITE-driver-with-AES-256
1/2