PDA

View Full Version : QSQLDatabase - Install QODBC (NOT MYSQL, but SQL Server 2008 R2 or Express)



xboxnissan
11th November 2011, 21:26
Hi,

I've been trying to open a connection to my database, but it says the following:

QSqlDatabase: QODBC driver not loaded
QSqlDatabase: available drivers: QSQLITE

So I try to find a forum that explains how to install SQL Server connection ODBC with QT, but I only get MySQL results and that's not what I want.

I want to connect to my SQL Server or Express (can install the express if needed.) to my application.

HOW to install QODBC on Qt 4.8 (not 4.1,4.2,4.3 ... it doesn't work.)

Thanks!

ChrisW67
11th November 2011, 23:24
You follow the instructions to build the ODBC plugin for Qt. Your source code location may be different if you are using the SDK rather than standalone sources. Works out-of-the box with Microsoft VS. For the bundled MingW compiler substitute mingw32-make in place of nmake. Run "nmake install" after the compilation to put the plugin in the correct location.

These instructions haven't changed since at least 4.5 and probably not since 4.0.