[Solved] SQLITE driver not loaded
-
wrote on 29 Aug 2011, 21:19 last edited by
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.
-
wrote on 30 Aug 2011, 00:24 last edited by
Never mind I figured out the problem.
-
wrote on 30 Aug 2011, 03:20 last edited by
What was the problem?
-
wrote on 30 Aug 2011, 19:01 last edited by
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.
-
wrote on 30 Aug 2011, 19:04 last edited by
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!
1/5