Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How can I open an existing Sqlite database?
freecamellia last edited by
If my database data.sqlite is located in my project folder, how can I call it and read/right from it. I want the database be a part of my project, not just an external file.
veeeee_d last edited by
@QSqlDatabase db = QSqlDatabase:addDatabase("QSQLITE");
bool opened = db.open();@
Also, add sql to your project's .pro, for example:
@QT += core sql
QT -= gui@
goetz last edited by
searches in the current working directory, if that's wrong, give an absolute path as the argument.