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. Qt5 - QODBC driver not loaded error even though ODBC driver is available
Forum Updated to NodeBB v4.3 + New Features

Qt5 - QODBC driver not loaded error even though ODBC driver is available

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 5.1k 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.
  • M Offline
    M Offline
    mugunth
    wrote on last edited by
    #1

    Hi,
    I am trying to use ODBC driver in my Qt 5.0 project.

    I compiled QODBC driver and copied the driver dlls to the Qt\Qt5.0.0\5.0.0\msvc2010\plugins\sqldrivers folder.

    When I try the following code.
    @ QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");@

    I get the following error:
    QSqlDatabase: QODBC driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC QODBC3

    Same error is encountered if I tried loading QODBC3 .

    Even though QODBC and QODBC3 drivers are present, Qt still could not load QODBC driver.

    I am running Windows 7 (64 bit) PC.

    Has anybody encountered such error? Any clues on what might be wrong ?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cincirin
      wrote on last edited by
      #2

      You need to copy qsqlodbc.dll in APP_DIR/sqldrivers folder where APP_DIR is your application executable path.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mugunth
        wrote on last edited by
        #3

        Thanks, that helped.

        1 Reply Last reply
        0

        • Login

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