Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QPSQL driver not loaded -> available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7

QPSQL driver not loaded -> available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7

Scheduled Pinned Locked Moved Solved Installation and Deployment
4 Posts 2 Posters 8.0k Views
  • 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.
  • N Offline
    N Offline
    noIdea
    wrote on last edited by
    #1

    Hello

    I'm relatively new to QT and C++.

    I've experience in PHP (OOP), Webdevelopement and C.
    Just for imagine with whom you are working with ;).

    I'm working on windows 7 64 Bit.
    QT 5.10.0 and Visual Studio Community 2017 15.5.1.

    I'm working here with somebody who created a program which connects to a PostgresSQL 9.3 all works fine for him. So now I just want to support him and installed everything (already multiply times).

    But I always get the same error:
    "QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7"

    I already tried to build the driver by my self but there are many things different to the instructions and got a lot of errors.
    Then I loaded the books example (http://doc.qt.io/qt-5/qtsql-books-example.html) it just works fine.

    Now I change this to QPSQL and I get the exactly same error.

    QSqlError initDb()
    {
    
           QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
           db.setHostName("bigblue");
           db.setDatabaseName("flightdb");
           db.setUserName("acarlson");
           db.setPassword("1uTbSbAs");
           bool ok = db.open();
           ...
    

    I don't know if I'm correct but i'm thinking I should get something like "Wrong username/password can't connect" or "Can't connect to database" instead of the driver....
    => Ok just tested.... my workmate (where it is working) get another message the one I would expect...

    So I already tried everything I'm able to.

    Anyone any idea what I should do?
    I just want that the driver works!

    Thank you very much

    S 1 Reply Last reply
    0
    • N noIdea

      Hello

      I'm relatively new to QT and C++.

      I've experience in PHP (OOP), Webdevelopement and C.
      Just for imagine with whom you are working with ;).

      I'm working on windows 7 64 Bit.
      QT 5.10.0 and Visual Studio Community 2017 15.5.1.

      I'm working here with somebody who created a program which connects to a PostgresSQL 9.3 all works fine for him. So now I just want to support him and installed everything (already multiply times).

      But I always get the same error:
      "QSqlDatabase: QPSQL driver not loaded
      QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7"

      I already tried to build the driver by my self but there are many things different to the instructions and got a lot of errors.
      Then I loaded the books example (http://doc.qt.io/qt-5/qtsql-books-example.html) it just works fine.

      Now I change this to QPSQL and I get the exactly same error.

      QSqlError initDb()
      {
      
             QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
             db.setHostName("bigblue");
             db.setDatabaseName("flightdb");
             db.setUserName("acarlson");
             db.setPassword("1uTbSbAs");
             bool ok = db.open();
             ...
      

      I don't know if I'm correct but i'm thinking I should get something like "Wrong username/password can't connect" or "Can't connect to database" instead of the driver....
      => Ok just tested.... my workmate (where it is working) get another message the one I would expect...

      So I already tried everything I'm able to.

      Anyone any idea what I should do?
      I just want that the driver works!

      Thank you very much

      S Offline
      S Offline
      Stoyan
      wrote on last edited by
      #2

      @noIdea
      It seems that drivers for PostgreSQL are missing (not deployed).
      Example works because it uses SQLite and its drivers are integrated in Qt.
      Look at this for what is necessary for PostgreSQL:
      https://forum.qt.io/topic/81148/cannot-install-postgresql-driver/7

      1 Reply Last reply
      2
      • N Offline
        N Offline
        noIdea
        wrote on last edited by
        #3

        libeay32.dll
        libintl-8.dll
        libpq.dll
        ssleay32.dll

        copied these files from "\PostgreSQL\9.3\bin"
        (libiconv-2.dll doesn't exist)

        and it works!

        Thank you very much :)

        S 1 Reply Last reply
        2
        • N noIdea

          libeay32.dll
          libintl-8.dll
          libpq.dll
          ssleay32.dll

          copied these files from "\PostgreSQL\9.3\bin"
          (libiconv-2.dll doesn't exist)

          and it works!

          Thank you very much :)

          S Offline
          S Offline
          Stoyan
          wrote on last edited by
          #4

          @noIdea said in QPSQL driver not loaded -> available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7:

          (libiconv-2.dll doesn't exist)

          The file "libiconv-2.dll" does exist and is necessary for PostgreSQL 9.4 and later.

          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