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. "SQL logic error or missing database Error opening database"

"SQL logic error or missing database Error opening database"

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 3.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.
  • S Offline
    S Offline
    Sypter
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      soundar
      wrote on last edited by
      #2

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

      Don't Follow Anyone but You Must Learn From Everyone.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sypter
        wrote on last edited by
        #3

        Which drivers?


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

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sypter
          wrote on last edited by
          #4

          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
          viewer.engine()->setOfflineStoragePath(<PATH>);
          #else
          QString privatePathQt(QApplication::applicationDirPath());
          QString pathOfflineStorage(privatePathQt);
          pathOfflineStorage.append(QDir::separator()).append(<PATH>);
          pathOfflineStorage = QDir::toNativeSeparators(pathOfflineStorage);
          viewer.engine()->setOfflineStoragePath(pathOfflineStorage);
          #endif@

          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.

          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