Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How open SQLite database in QML



  • 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


  • Lifetime Qt Champion

    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.


Log in to reply