Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Could not open database or xml outside qtcreator installation platform
Forum Updated to NodeBB v4.3 + New Features

Could not open database or xml outside qtcreator installation platform

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 3 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.
  • M Offline
    M Offline
    Mar91
    wrote on last edited by
    #1

    I am running on windows 7 + qtcreator 2.0.1, and i am managing an sqlite database: here is the code:

    @
    //OPENING AND SETTING UP THE DATABASE
    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE",myconn);
    db.setDatabaseName(QCoreApplication::applicationDirPath()+QDir::separator()+"Application.db");
    db.open() //Returnin false! :(
    @

    The xml code has the same behaviour ..
    This code works good into win7, so i compiled the app and moved it ( exe+dll ) to xp. I started the application and the db could not be found from the point of view of db.setdatabasename. I installed Qtcreator on xp, and then everything works. It seems that there must be another library hidden somewhere that has xml and database support What do i have to add to my project in order to support sqlite and xml out of the box?
    Those are the file i have near my exe:
    Application.db
    libgcc_s_dw2-1.dll
    mingwm10.dll
    QtCore4.dll
    QtCored4.dll
    QtGui4.dll
    QtGuid4.dll
    QtNetwork4.dll
    QtNetworkd4.dll
    QtSql4.dll
    QtSqld4.dll
    QtXml4.dll
    QtXmld4.dll
    SpeedyInstaller2.exe
    test.xml

    Thanks :)

    EDIT: moved to install and deployment, gerolf

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Make sure to also ship the Qt plugins.

      There are tools to watch which files a application is trying to open available for windows. Those are really great to find out what is missing in a installation. My guess is that you do not have the sqlite plugin in your installation.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        You have a distribution problem, which was already often discussed here on DevNet. And it is also described in the docs.

        look in "this":http://developer.qt.nokia.com/forums/viewthread/4538/ or "this":http://developer.qt.nokia.com/forums/viewthread/4440/ thread.

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        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