0

Im trying to connect to a remote SQL Server database. When trying to add "QODBC" as my QSqlDatabase, I get the following error on the runtime:

My Code snippet:

               QStringList drivers = QSqlDatabase::drivers();
               qDebug()<<"drivers list: "<<drivers;
               QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");

Error:

         drivers list:  ("QODBC3", "QODBC") 
         Cannot mix incompatible Qt library (version 0x40804) with this library (version 0x40803)

As you can see the output of my drivers list shows that I have the drivers available. The .pro file has "QT += sql", I have followed the instructions on QT support blog to build the odbc drivers and added them to my application folder as "sqldrivers" sub folder. I can't seem to find how do I solve the Version Incompatibility error. Any help in resolving this issue will be appreciated, thanks.

2 Answers 2

0

Your QODBC library is incompatible with your Qt library, maybe you should build QODBC library with your qt version. There is a guide: http://qt-project.org/doc/qt-4.8/sql-driver.html

Sign up to request clarification or add additional context in comments.

1 Comment

I followed the guide to build the QOBDC sqldrivers in the first place. Not sure how to remove the older version.
0

Solved: The issue was the QtCore & QtGui dll's in my application release folder was a older qt 4.8.3, changed this to the current qt 4.8.4.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.