Important: Please read the Qt Code of Conduct -

"SQL logic error or missing database Error opening database"

  • I'm trying to incorporate a database within the application, by changing the offlinestorage path. So far i've successfully made it work on the simulator but when i run it on a device i'm getting the following error: "SQL logic error or missing database Error opening database".
    Has this happened to someone else?

    Thank you.

  • Please check what are the drivers available in your system then connect that drivers.

  • Which drivers?

    Btw, the database i'm trying to incorporate was created in the simulator and copied from "....\Nokia\QtSimulator\data\QML\OfflineStorage\Databases".

  • So it happens i was using the same path for both simulator and device, which is not correct.
    I can access the database with:

    @#ifdef Q_WS_SIMULATOR
    QString privatePathQt(QApplication::applicationDirPath());
    QString pathOfflineStorage(privatePathQt);
    pathOfflineStorage = QDir::toNativeSeparators(pathOfflineStorage);

    Now i can access it but i can't edit it permanently.
    I run it in the simulator, make some changes in a table and when i restart it the changes are not saved.

Log in to reply