Important: Please read the Qt Code of Conduct -

Qodbc + W7 pro 64 bit problem [Solved]

  • Hi all,
    I got a strange problem using mysql odbc in a Qt app for Windows 7 pro 64 bit.

    I was deploying using QtSDK 1.2.1. The same application ran without problems in Q7 32 bit.

    Running the application in W7 pro 64 bit I get this message from QODBC driver:
    The specified DSN contains an architecture mismatch between the Driver and Application

    and this is the code:
    QSqlDatabase db;
    db = QSqlDatabase::addDatabase("QODBC");

        qDebug() << "OK";
        qDebug() << "KO";
        qDebug() << db.lastError();


    As I wrote before, the same code works fine in other W7 systems.

    Finally I found this solution (but I don't know why does it works... ) :

    • installed the mysql odbc 32 bit (not 64)
    • executed c:\windows\sysWOW64\odbcad32
    • added the new odbc DSN in "System DSN"

    I hope this can help you if you had the same problem... ;-)

  • I have the same problem, but I use Oracle plugin (with QODBC and QOCI), and I wasn't able to make it work. Somebody had the same problem?

Log in to reply