Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. SQL LITE -3 DATABASE LINKING WITH QT CREATOR
Forum Updated to NodeBB v4.3 + New Features

SQL LITE -3 DATABASE LINKING WITH QT CREATOR

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 2 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.
  • Q Offline
    Q Offline
    qt_ankit_developer
    wrote on 3 Aug 2018, 06:09 last edited by
    #1

    hello,
    My Qt C++ project involves SQLite databases.
    I have to link SQLite-3 database with qt creator as a dynamic library.
    to store my data in the database.
    currently, I have given a static path ex. (/home/pi/Desktop/database.db) to the database, but I want to give a dynamic ex. (:/datbase.db) path to my database.db so
    please help me regarding the dynamic path linking of SQLite lite database with qt creator.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 3 Aug 2018, 06:17 last edited by
      #2

      Hi
      You can use
      http://doc.qt.io/qt-5/qstandardpaths.html
      to find a good location to have it stored.

      1 Reply Last reply
      1
      • Q Offline
        Q Offline
        qt_ankit_developer
        wrote on 3 Aug 2018, 09:34 last edited by
        #3

        I have added my database.db file in qt creator resources and copy the path by right click on database .db.
        I tried to open the database but database not open error is showing
        Help me regarding this ?..

        M 1 Reply Last reply 3 Aug 2018, 09:36
        0
        • Q qt_ankit_developer
          3 Aug 2018, 09:34

          I have added my database.db file in qt creator resources and copy the path by right click on database .db.
          I tried to open the database but database not open error is showing
          Help me regarding this ?..

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 3 Aug 2018, 09:36 last edited by
          #4

          @qt_ankit_developer

          Hi
          You cannot use Sqllite db when in a res file as its read only.
          You will need to use qstandardpaths + QFile::copy and copy it to
          writable location and then open it.

          1 Reply Last reply
          1
          • Q Offline
            Q Offline
            qt_ankit_developer
            wrote on 3 Aug 2018, 13:44 last edited by
            #5

            @mrjj said in SQL LITE -3 DATABASE LINKING WITH QT CREATOR:

            in a res fil

            is ther any other way to add database in dynamic path

            M 1 Reply Last reply 3 Aug 2018, 14:24
            0
            • Q qt_ankit_developer
              3 Aug 2018, 13:44

              @mrjj said in SQL LITE -3 DATABASE LINKING WITH QT CREATOR:

              in a res fil

              is ther any other way to add database in dynamic path

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 3 Aug 2018, 14:24 last edited by
              #6

              @qt_ankit_developer
              Hi
              what is wrong with standardpaths ?

              1 Reply Last reply
              0

              1/6

              3 Aug 2018, 06:09

              • Login

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