You are not logged in.


Monday, May 22nd 2017, 4:32pm

QSQLITE driver not loaded

I'm developing a program in Visual Studio 2008 using Qt. I need to connect to a database, so I'm using QSql with the function
dblog = QSqlDatabase::addDatabase("QSQLITE")

As mentioned in different forum I've created a folder sqldrivers cointaining Qsqlite drivers in the same folder of the application but I continue to have the error:
QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers

So, i tried to change the name of the folder in plugins->sqldrivers but It is still not working. I tried to add the function
a.addLibraryPath(QApplication::applicationDirPath() + QDir::separator()+ "plugins");
a.addLibraryPath(QApplication::applicationDirPath() + QDir::separator()+ "sqldrivers");
without success.

Any idea?
Thank you in advance


Tuesday, May 23rd 2017, 7:09am


I partially solved my problem using 4.7.3 libraries from 4.6. Now the driver is recognized but when I try to do an operation I have the error: QSqlQuery::exec: database not open
Is it related to driver or to an other problem?
Thank you

Similar threads