Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [SOLVED] - new old discution - QSqlDatabase: QPSQL driver not loaded

    General and Desktop
    2
    6
    4310
    Loading More Posts
    • 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.
    • A
      angelicaP last edited by

      Hi,

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

      My system: Windows 7, Qt 5.4 installed recently, previous Qt 5.2; Postgresql 9.4 installed recently, previous Postgresql 9.3

      I had Qt 5.2 installed with Postgresql 9.3, everything worked OK. after upgrading to Qt 5.4 and Postgresql 9.4, I got this error while opening the same application.

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

      the application didn't change.
      Any idea what could be?
      thank you.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        did you check your PATH environment variable (the one in the Run part of the Project panel ? It might be still containing the path to your old PostgreSQL.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • A
          angelicaP last edited by

          Hi,
          thanks for your feedback.
          The PATH variable mentions the
          "C:\Qt\Qt5.4.0\5.4\mingw491_32\lib"
          path, which corresponds to the Qt 5.4 directory. Nowhere in the settings the old Qt 5.2 folder is mentioned.

          what am I doing wrong?
          thank you.

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            I meant the PostgreSQL folder

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • A
              angelicaP last edited by

              the PostgreSql\bin\lib folder was missing from the PATH variable.
              problem solved.
              Any idea why this folder wasn't mentioned?
              thank you.

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                Good question, on Windows it's always a bit complicated. As for deployment, every dll you need should be accessible by your application, so you either need to have them in a folder in the PATH environment variable or have them in the same folder as your application. But it's also a bad idea to have every paths in your PATH variable since you could have several applications using dlls from the same library but at different versions thus there's the risk of breaking one of them. That's why Qt Creator modifies the PATH variable when you run your application so you have an isolated scope to work with.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post