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. [solved]SQLite database in Qt visual studio add-in
Forum Update on Monday, May 27th 2025

[solved]SQLite database in Qt visual studio add-in

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.8k 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.
  • A Offline
    A Offline
    AntonZelenin
    wrote on 31 Aug 2015, 09:22 last edited by AntonZelenin 9 Jan 2015, 06:07
    #1

    How can I make SQLite working in VS? In Qt Creator I added QT += sql into a .pro file, but there is no such file in VS.
    And, probably, because of this, when I add all necessary libraries and write "QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");db.setDatabaseName("logs_database");" there are dozen errors, something like 'unresolved external symbol referenced in function main'. And one more thing. In VS i can't add just <QtSql>, I have to add all libraries which contains in this folder, like #include <QtSql\qsql.h>, #include <QtSql\qsqlquery.h>, #include <QtSql\qsqldatabase.h> bla bla bla.......Is there any way to add only one folder, or maby file?

    1 Reply Last reply
    1
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 31 Aug 2015, 21:15 last edited by
      #2

      Hi,

      You can generate a Visual Studio project from you pro file and have everything setup for you. There's also the Qt VisualStudio AddIn that you could use.

      Hope it helps

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

      A 2 Replies Last reply 1 Sept 2015, 05:18
      0
      • S SGaist
        31 Aug 2015, 21:15

        Hi,

        You can generate a Visual Studio project from you pro file and have everything setup for you. There's also the Qt VisualStudio AddIn that you could use.

        Hope it helps

        A Offline
        A Offline
        AntonZelenin
        wrote on 1 Sept 2015, 05:18 last edited by
        #3

        @SGaist
        I exactly use Qt VisualStudio AddIn, and I have a project, in which I need to add a database and I don't know how I can do this. If I understood you correctly, if I generate a Visual Studio project from pro file, it will be a new empty project, but I don't want to copy all my code into new project)) Maybe there is a way just to add some settings?

        1 Reply Last reply
        0
        • S SGaist
          31 Aug 2015, 21:15

          Hi,

          You can generate a Visual Studio project from you pro file and have everything setup for you. There's also the Qt VisualStudio AddIn that you could use.

          Hope it helps

          A Offline
          A Offline
          AntonZelenin
          wrote on 1 Sept 2015, 06:07 last edited by
          #4

          @SGaist
          I no longer need an answer, I decided to move my project to qt creator so I don't have any problems anymore=)

          1 Reply Last reply
          0

          1/4

          31 Aug 2015, 09:22

          • Login

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