I am getting the driver not loaded error when trying to open an sqlite database with Qt 5.15.0 on Windows.
Here is my output: QSqlDatabase: QSQLITE driver not loaded QSqlDatabase: available drivers: QSQLITE QPSQL QPSQL7 QODBC QODBC3 "Driver not loaded Driver not loaded"Here are the files in the directory with my .exe (currently and for this output): main.o app.exe qrc_qml.cpp qrc_qml.o
I have done some searches on this topic and they have suggested the following:
- manually move the sqldrivers folder to the exe directory or try moving its contents to the directory, neither have resolved my issue, output remains the same
- use windeployqt. I have tried this but despite it moving the dlls including moving the sqldrivers folder to the exe directory, the same error appears
Please let me know what you suggest
QSqlDatabase my_db = QSqlDatabase::addDatabase("QSQLITE");
my_db.setDatabaseName("test.db");
if(my_db.open())
{
qDebug() << "open";
}
else
{
qDebug() << my_db.lastError().text();
}