[Solved] SQLITE driver not loaded



  • I recently built Qt with VS2010 following this tutorial here: "http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/":http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/ which worked perfectly.
    However, when I go to use QSqlDatabase I am unable to use it with SQLITE (drivers not loaded drivers not loaded).
    I believe that the tutorial I followed did build them because I can find all the dll's in the plugins/sqldrivers folder.
    I also created the sqldrivers folder in the applications executable directory, and put qsqlited4.dll and qsqlited4.lib in there with no success.
    Do I have to use the <QPlugin> functions to get this to work?

    Thank you for any help.



  • Never mind I figured out the problem.


  • Moderators

    What was the problem?



  • I was using the second parameter of the QSqlDatabase::addDatabase() function incorrectly. Its easy to forgot that static functions inside a class work just like normal functions.

    For those of you who have read the tutorial that I followed in the link I posted above, it appears that the standard configure commands builds the qsqlite dlls and libs automatically, without having to specify the switch in the parameters. No other databases are included though without an explicit switch.


  • Moderators

    Good to know. Hopefully your solution can help anyone else that might be having the same problem.

    Don't forget to edit the topic title and add [Solved]. Thanks!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.