Here is how I built and installed the debug plugin using a recent Qt SDK and the bundled MingW tools. The instructions are not far removed from what is in the documentation, total elapsed time 10 minutes.
Start Qt command shell
C:\>cd \qtsdk\QtSources\4.7.3\src\plugins\sqldrivers\odbc
C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\odbc> qmake odbc.pro
C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\odbc> mingw32-make
C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\odbc> mingw32-make install
Start Qt command shell
C:\>cd \qtsdk\QtSources\4.7.3\src\plugins\sqldrivers\odbc
C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\odbc> qmake odbc.pro
C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\odbc> mingw32-make
C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\odbc> mingw32-make install
To copy to clipboard, switch view to plain text mode
If you want a release version then the second command becomes:
C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\odbc> qmake CONFIG+=release odbc.pro
C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\odbc> qmake CONFIG+=release odbc.pro
To copy to clipboard, switch view to plain text mode
So your specific issues:
Which version of Qt is your app using?
Which version did you you use to build the ODBC driver?
Which compiler did you use to build the plugin?
Where did you place the file?
Is it a debug or release version?
Does it match your application?
What are you passing as the second argument of the addDatabase() call? To be clear, it is not an ODBC connection string.
What does db.lastError() return after the open() fails?
What type of ODBC data source are you trying to access?
Do you have a named ODBC data source called "oms_gdl" in the ODBC adminstrator?
Have you tested this connection from the administration panel?
Your PRO file is odd. You only need:
QT += sql
QT += sql
To copy to clipboard, switch view to plain text mode
to add SQL support. I have no idea where the other two lines came from. In general a measured approach is better than a scatter gun.
Bookmarks