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. QODBC driver not loaded
Forum Updated to NodeBB v4.3 + New Features

QODBC driver not loaded

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 4 Posters 3.7k Views 2 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.
  • CadNetoC Offline
    CadNetoC Offline
    CadNeto
    wrote on last edited by
    #1

    Is there someone that saw this message ?

    QSqlDatabase: QODBC driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7

    for QODBC ?

    Windows 10, 64 bits
    PostgreSQL 9.5 using PostgreSQL ODBC Driver (UNICODE)

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hrompato
      wrote on last edited by
      #2

      You must create sqldrivers folder in your run directory and copy the qt sqldriver inside

      1 Reply Last reply
      0
      • CadNetoC Offline
        CadNetoC Offline
        CadNeto
        wrote on last edited by
        #3

        So simple ?......really ?

        1 Reply Last reply
        0
        • CadNetoC Offline
          CadNetoC Offline
          CadNeto
          wrote on last edited by
          #4

          I tried, but it did not work........I'm doing something wrong !

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hrompato
            wrote on last edited by hrompato
            #5

            The driver is psqlodbc.dll also must have created the system DSN pointing to the database

            I used this code to connect:

            QSqlDatabase db = QSqlDatabase::addDatabase("QODBC", "InternalName" (or nothing if use only one db));
            db.setDatabaseName("DbName" (System DSN ODBC Name));
            db.setUserName("User");
            db.setPassword("Password");
            db.setHostName("Host");

            1 Reply Last reply
            0
            • beeckscheB Offline
              beeckscheB Offline
              beecksche
              wrote on last edited by beecksche
              #6

              @CadNeto
              The odbc driver is not included in Qt 5.6 (https://bugreports.qt.io/browse/QTBUG-49420). You have to built it by your own (http://doc.qt.io/qt-5.6/sql-driver.html#qodbc-for-open-database-connectivity-odbc).

              1 Reply Last reply
              0
              • CadNetoC Offline
                CadNetoC Offline
                CadNeto
                wrote on last edited by
                #7

                Ok, I have to built it.
                And the way is to use the commands:

                cd C:/Qt/5.6/Src/qtbase/src/plugins/sqldrivers/odbc
                qmake odbc.pro
                nmake
                nmake release
                nmake install
                nmake release-install

                Please, how is the right way to use the "nmake". In my case, nmake is not recognized.
                thank you.

                1 Reply Last reply
                0
                • mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @CadNeto said:

                  nmake

                  This is the visual studio make tool.

                  Do you have VS installed?

                  Qt can use different compilers. Normally its mingw or visual studio 201X
                  on windows.
                  These instructions seems to be for VS
                  for mingw compiler
                  nmake would be Mingw32-make
                  mine is located at
                  D:\Qt\Tools\mingw492_32\bin\mingw32-make.exe

                  1 Reply Last reply
                  0
                  • CadNetoC Offline
                    CadNetoC Offline
                    CadNeto
                    wrote on last edited by
                    #9

                    rss.......it works.
                    A right tip make a certain job.....rss
                    Thank you!

                    1 Reply Last reply
                    1

                    • Login

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