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. No SQL driver available
Qt 6.11 is out! See what's new in the release blog

No SQL driver available

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.3k 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.
  • Please_Help_me_DP Offline
    Please_Help_me_DP Offline
    Please_Help_me_D
    wrote on last edited by
    #1

    Hi,

    I try to use SQLITE in my project.
    In QMAKE I add:

    QT       += core gui sql opengl
    

    But when I check availabele drivers by typing:

    QStringList driverNmaeList = QSqlDatabase::drivers();
    

    I get empty string list. How to add SQLITE? Do I need explicitly add SqLite library to the project?

    Windows 10, Qt 5.14.2, MSVC 2017

    C 1 Reply Last reply
    0
    • Please_Help_me_DP Please_Help_me_D

      Hi,

      I try to use SQLITE in my project.
      In QMAKE I add:

      QT       += core gui sql opengl
      

      But when I check availabele drivers by typing:

      QStringList driverNmaeList = QSqlDatabase::drivers();
      

      I get empty string list. How to add SQLITE? Do I need explicitly add SqLite library to the project?

      Windows 10, Qt 5.14.2, MSVC 2017

      C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @Please_Help_me_D

      How did you obtain and install Qt? Is this condition on your development box or in a deployed environment?

      No, you do not need to explicitly add source files from sqlite to your project. The Qt sqlite plugin has sqlite built in, but this plugin needs to be present. It should be present in the ...\plugins\sqldrivers\ directory or either your development copy of Qt5 or your deployed application's folder structure.

      Please_Help_me_DP 3 Replies Last reply
      0
      • C ChrisW67

        @Please_Help_me_D

        How did you obtain and install Qt? Is this condition on your development box or in a deployed environment?

        No, you do not need to explicitly add source files from sqlite to your project. The Qt sqlite plugin has sqlite built in, but this plugin needs to be present. It should be present in the ...\plugins\sqldrivers\ directory or either your development copy of Qt5 or your deployed application's folder structure.

        Please_Help_me_DP Offline
        Please_Help_me_DP Offline
        Please_Help_me_D
        wrote on last edited by
        #3

        @ChrisW67 yes I have those drivers in the folder. I installed Qt in standard way: I downloaded Qt installer from Qt web site.
        Probably I need to set some environment vars?
        I have QTDIR = C:\Qt\5.14.2\msvc2017_64
        306111d1-7207-4182-a832-85a52d8a14ff-image.png

        1 Reply Last reply
        0
        • C ChrisW67

          @Please_Help_me_D

          How did you obtain and install Qt? Is this condition on your development box or in a deployed environment?

          No, you do not need to explicitly add source files from sqlite to your project. The Qt sqlite plugin has sqlite built in, but this plugin needs to be present. It should be present in the ...\plugins\sqldrivers\ directory or either your development copy of Qt5 or your deployed application's folder structure.

          Please_Help_me_DP Offline
          Please_Help_me_DP Offline
          Please_Help_me_D
          wrote on last edited by Please_Help_me_D
          #4

          @ChrisW67 I just found that Qt can't see SQL drivers only in my current project. In any test project I can see them.
          According to this I can supplement the question:
          My current project contains two subprojects: app and core. app depends on core.
          Both subprojects include QT += sql but core I compile to the shared library. So core doesn't have main.cpp and it doesn't have QApplication a(argc, argv);. My app subproject has main.cpp and QApplication a(argc, argv);.
          May that be a reason?

          1 Reply Last reply
          0
          • C ChrisW67

            @Please_Help_me_D

            How did you obtain and install Qt? Is this condition on your development box or in a deployed environment?

            No, you do not need to explicitly add source files from sqlite to your project. The Qt sqlite plugin has sqlite built in, but this plugin needs to be present. It should be present in the ...\plugins\sqldrivers\ directory or either your development copy of Qt5 or your deployed application's folder structure.

            Please_Help_me_DP Offline
            Please_Help_me_DP Offline
            Please_Help_me_D
            wrote on last edited by
            #5

            @ChrisW67 I simply did full rebuild (clean project, deleted built folder, run QMAKE, build) and it worked!
            Thank you for help.

            Pablo J. RoginaP 1 Reply Last reply
            0
            • Please_Help_me_DP Please_Help_me_D

              @ChrisW67 I simply did full rebuild (clean project, deleted built folder, run QMAKE, build) and it worked!
              Thank you for help.

              Pablo J. RoginaP Offline
              Pablo J. RoginaP Offline
              Pablo J. Rogina
              wrote on last edited by
              #6

              @Please_Help_me_D said in No SQL driver available:

              and it worked!

              great, so please don't forget to mark you post as solved!

              Upvote the answer(s) that helped you solve the issue
              Use "Topic Tools" button to mark your post as Solved
              Add screenshots via postimage.org
              Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

              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