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. database
Forum Updated to NodeBB v4.3 + New Features

database

Scheduled Pinned Locked Moved General and Desktop
13 Posts 3 Posters 4.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.
  • SGaistS SGaist

    Hi,

    First thing to do is to add

    QT += sql

    To your pro file

    K Offline
    K Offline
    kavin.motlani
    wrote on last edited by
    #4

    @SGaist Its already added. What should I do next?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #5

      What error did you got next ?

      What OS and Qt version are you running ?

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

      K 1 Reply Last reply
      0
      • V Offline
        V Offline
        Vince Golubic
        wrote on last edited by Vince Golubic
        #6

        Check the Database examples in Qt 4.x. Lots of good examples there that haven't changed much in Qt5.x.

        Basically if the Qt related library/drivers aren't installed (for database model you need) where they can be found in your Qt path (check all assumptions on where you have installed Qt) the qmake and linker will have issues and report errors.

        -Vince

        K 1 Reply Last reply
        0
        • SGaistS SGaist

          What error did you got next ?

          What OS and Qt version are you running ?

          K Offline
          K Offline
          kavin.motlani
          wrote on last edited by
          #7

          @SGaist I am using windows 8 and QT 5.4
          The errors I have mentioned in the post

          1 Reply Last reply
          0
          • V Vince Golubic

            Check the Database examples in Qt 4.x. Lots of good examples there that haven't changed much in Qt5.x.

            Basically if the Qt related library/drivers aren't installed (for database model you need) where they can be found in your Qt path (check all assumptions on where you have installed Qt) the qmake and linker will have issues and report errors.

            -Vince

            K Offline
            K Offline
            kavin.motlani
            wrote on last edited by
            #8

            @Vince-Golubic How do I know whether the required libraries or drivers are installed?
            And If they are not what should I do next?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #9

              Did you re-run qmake after adding QT += sql ?

              As for the additional libraries, you should have the MySQL client libraries installed.

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

              K 1 Reply Last reply
              0
              • SGaistS SGaist

                Did you re-run qmake after adding QT += sql ?

                As for the additional libraries, you should have the MySQL client libraries installed.

                K Offline
                K Offline
                kavin.motlani
                wrote on last edited by
                #10

                @SGaist the console screen appears with the following output

                QSqlDatabase : QMySQL driver not loaded
                QSqlDatabase : available drivers: QSLQITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
                "Driver not loaded Driver not loaded"

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #11

                  Please, search the forum a bit, that problem has already been discussed many times.

                  You need to install the MySQL client libraries and add the path to them to your Run panel's PATH environment variable

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

                  K 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Please, search the forum a bit, that problem has already been discussed many times.

                    You need to install the MySQL client libraries and add the path to them to your Run panel's PATH environment variable

                    K Offline
                    K Offline
                    kavin.motlani
                    wrote on last edited by
                    #12

                    @SGaist Can you just please tell me how to add path

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #13

                      Projects -> Run -> Run Environment -> edit the value of PATH

                      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
                      0

                      • Login

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