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");
db.setDatabaseName("ODBC;DSN=gw_register;DATABASE="+db_name);
db.setHostName(ip);
db.setUserName(user);
db.setPassword(pwd);if(db.open()) { qDebug() << "OK"; } else { qDebug() << "KO"; qDebug() << db.lastError(); exit(123); }
@
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?