QSQLITE driver not loaded - where to put qt database driver plugins

前端 未结 5 558
慢半拍i
慢半拍i 2020-12-09 04:22

I am using VS2008 & QT plugin to make my application. After making package when I am running the application I am getting error :

QSqlDatabase: QSQLITE d         


        
5条回答
  •  臣服心动
    2020-12-09 05:00

    Well, the function: addDatabase("QSQLITE"); takes two parameters, the first is the driver and the second is the name of your connection, (passed as a QString)

    Now, try the following:

    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", "SQLITE");
    

    It worked for me, so I guess it'll work for you. (Assuming SQLITE is among your installed drivers)

    You can check for SQLITE by the following:

    qDebug()  <<  QSqlDatabase::drivers();
    

    Good luck!

    Zaher J.G.

提交回复
热议问题