0

I am creating a database with Qt and I am trying to set an username and a password to lock the sqlite3 database from outside of my application. But I still can open it with my database manager (DB Browser for SQLite).

Also, I am using Qt 5.15.2 and Linux mint 20.1.

Here is my code :

db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(m_path + m_dataBaseName + m_extension);
db.setUserName(databaseUsername);
db.setPassword(databasePassword);

Thanks in advance to anyone who tries to help me

1 Answers1

1

The plain sqlite has no encryption support so this will not work. See also e.g. SQLite with encryption/password protection for more information about this.

chehrlic
  • 913
  • 1
  • 5
  • 5