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.
  • qt_ankit_developerQ Offline
    qt_ankit_developerQ Offline
    qt_ankit_developer
    wrote on 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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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
      • qt_ankit_developerQ Offline
        qt_ankit_developerQ Offline
        qt_ankit_developer
        wrote on 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 ?..

        mrjjM 1 Reply Last reply
        0
        • qt_ankit_developerQ qt_ankit_developer

          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 ?..

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on 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
          • qt_ankit_developerQ Offline
            qt_ankit_developerQ Offline
            qt_ankit_developer
            wrote on 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

            mrjjM 1 Reply Last reply
            0
            • qt_ankit_developerQ qt_ankit_developer

              @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

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @qt_ankit_developer
              Hi
              what is wrong with standardpaths ?

              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