Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Issue with QSqlDatabase::addDatabase(“QODBC”) Qt 4.8.4
Forum Updated to NodeBB v4.3 + New Features

Issue with QSqlDatabase::addDatabase(“QODBC”) Qt 4.8.4

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JerryLouis
    wrote on 6 Feb 2013, 20:46 last edited by
    #1

    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/Console output:
    @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.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Hostel
      wrote on 6 Feb 2013, 23:42 last edited by
      #2

      Do you have on your system another version of Qt?

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JerryLouis
        wrote on 7 Feb 2013, 09:50 last edited by
        #3

        No there is only one installation & that is 4.8.4.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          JerryLouis
          wrote on 7 Feb 2013, 11:21 last edited by
          #4

          Solved it: looks like the QtCore & QtGui dll's in the application folder was not the same version as of the Qsqlodbc.dll, added the same version dll's and it worked.

          1 Reply Last reply
          0

          1/4

          6 Feb 2013, 20:46

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved