So it's wrong. There should be no "plugins" directory but rather immediately the "sqldrivers" entry with qsqlite dll inside.
So it's wrong. There should be no "plugins" directory but rather immediately the "sqldrivers" entry with qsqlite dll inside.
I already tried with no "plugins" directory and immediatly the sqldrivers directory => No change, still the same error : DRIVER NOT LOADED.
Make sure you are not mixing debug and release libraries (e.g. having debug Qt libs with a release qsqlite4.dll or vice versa).
I'm completely lost. I have the right release dll in the right folder or at the root ... I don't know what to do .
create a complete and compilable example that contains your problem. And then show us ALL of the information. It's right there in my sig.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Ok thanks for your answer.
This is a complete and compilable example :
The way is simple :
1 - The external software load the DLL using the DLLStart() method
2 - In the DLLStart() method I create a SDManagerSimConnect object
3 - In the SDManagerSimConnect constructor I open a SimConnect connexion using SimConnect_Open()
4 - Then we arrive in the void SDManagerSimConnect::OnRecvOpen() method
5 - I do my stuff creating some menu etc ... in my external app and when I click on one of my menu created before we arrive in the void SDManagerSimConnect::OnRecvEvent()
6 - In the SDManagerSimConnect::requestPayload() method I just call SimConnect_RequestDataOnSimObjectType()
7 - Then we arrive in the void SDManagerSimConnect::OnRecvSimobjectDataByType()
8 - Now Qt start, I create a SDManagerDataBase object etc ...
SDManager.cpp :
http://pastebin.com/w3a7PT5M
SDManagerSimConnect.h :
http://pastebin.com/WAAgn7Dq
SDManagerSimConnect.cpp :
http://pastebin.com/xPFm4Rnr
SDManagerDataBase.h :
http://pastebin.com/eTadjJQq
SDManagerDataBase.cpp :
http://pastebin.com/qzvkyEqV
Sorry for the pastebin I was obligated to use this because of the caracter lenght restriction.
Sorry for my english and thank you very much.
Did you create an instance of QApplication somewhere in your code prior to trying to access the database?
I don't know where to create the QApplication to not be blocked by the .exec()
You don't have to call exec(). It's enough to create the application instance as it is the one loading database drivers.
Hello !
Still the same issue :
With this code :DRIVER NAME : QSQLITE
SQL OPEN : 0
SQL ERROR : Driver not loaded Driver not loaded
Qt Code:
qint32 argc = 1; char *argv[] = {"SDMANAGER_MAIN"}; lApplicationFenetre.setStyle("plastique"); dB = new SDManagerDataBase(); dB->open();To copy to clipboard, switch view to plain text mode
Qt Code:
void SDManagerDataBase::open() { db.setDatabaseName("E:/FSX/Modules/SDManager/SDManager.s3db"); db.open(); return; out << "DRIVER NAME : " << db.driverName() << endl; out << "SQL OPEN : " << db.isOpen() << endl; out << "SQL ERROR : " << db.lastError().text() << endl; }To copy to clipboard, switch view to plain text mode
I think the path to the sql drivers is incorrect. Try putting the sqldrivers directory in the same directory as the main binary, not where your dll is located. Alternatively use qt.conf.
What is the main binary ? And where it can be ?
OMG !
It works !
I just create folders :
C:\Qt\4.8.3\plugins\sqldrivers
and IT WORKS !
But I'am obligated to do this when I will produce my application ?
Create all this folders ? like in the main binary ?
Bookmarks