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"
Forum Updated to NodeBB v4.3 + New Features

"SQL logic error or missing database Error opening database"

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 3.0k 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 11 Jun 2012, 10:29 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 11 Jun 2012, 13:17 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 12 Jun 2012, 09:10 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 15 Jun 2012, 09:40 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

          1/4

          11 Jun 2012, 10:29

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved