Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Open DB from local URL
Qt 6.11 is out! See what's new in the release blog

Open DB from local URL

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 2.5k 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.
  • V Offline
    V Offline
    Vetryaspa
    wrote on last edited by
    #1

    hi, I have a problem, I have to read and connect from local DB "mydb.db" SQLite so i create the connection:

    @ilMeteoDB = QSqlDatabase::addDatabase("QSQLITE","MYDB");
    ilMeteoDB.setDatabaseName(QCoreApplication::applicationDirPath() + "/mydb.db");@

    with this method I can create the connection and i can use "mydb.db" because the path of file is correct [the path is inside my project] but this method work only whit simulator because the path to application.exe is correct.

    but when i try to launch the application on device (Nokia - N8) the path that the method "applicationDirPath()" return is not correct to generate the db connection. I have read that isn't necessary the path from Embedded url but if i delete the method the result is the same. in particular the program generate a connection but if i return, for example, the name of the table of my db return only 1 table call "sqlite_master" or somthing like this and i can't interact whit my DB.

    now my answer is: how can i call my DB file correctly to generate the exaclty connection?

    sorry for my bad english and tnx if someone can help me.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      loladiro
      wrote on last edited by
      #2

      What does the applicationDirPath() method output on your device and what do you expect it to output?

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Vetryaspa
        wrote on last edited by
        #3

        I expect the path of my application dir but it return this path "C:/Private/e6940e0f/" and i have search in my device this path whit external program to show hide dir but.... not exist...

        1 Reply Last reply
        0
        • L Offline
          L Offline
          loladiro
          wrote on last edited by
          #4

          Have a look at "this bug report":http://bugreports.qt.nokia.com/browse/QTBUG-18944

          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