Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How open SQLite database in QML
Qt 6.11 is out! See what's new in the release blog

How open SQLite database in QML

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 1.2k 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.
  • J Offline
    J Offline
    JirkaH
    wrote on last edited by
    #1

    Hi guys,
    I have a problem with opening existing SQLite database in QML.
    When I use function LocalStorage.openDatabaseSync("D:\myDb.db", "1.0", "My Database", 1000000), database is not open but new database is created somwhere in folder (offlineStoragePath() + /Database) with encrypted ("D:\myDb.db") name.
    Is any way to open existing "D:\myDb.db" database from QML?
    Thank for answer
    Jiri

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

      Hi,

      If you want to access databases from random locations, you should rather consider using a wrapper class on top of the C++ QSql classes and make it available to your QtQuick application.

      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