I am trying to create a SQLite database in Qt. Here is my code:
QDir databasePath; QString path = databasePath.currentPath()+"myDb.db"; QSqlDatabase dbConnection = QSqlDatabase:addDatabase("QSQLITE"); db.setDatabaseName(path); db.open();
There are no errors when starting the code, but I cannot find the database I created in the path you specified. Does this really create a database or just do some initialization?
If it does not create a database, then how do I create a database in the application itself? (I'm not talking about the insert.)
c ++ database sqlite qt
user3009135
source share