Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2009

    Deploying sqlite db file to N8 fails (can never find db file)

    Apologies I realize this question gets asked a lot, but cannot find the answer.
    My existing sqlite db is found and opened when running the simulator in my win7 dev environment. The db file is searched for (and found) under %CURRENT_USER%.
    When deploying to N8, the file is never found. Looks like the app always looks in c:\ location and can never find the file.

    In my PRO file I have:

    QT += core \
    gui \

    database.sources = mydb.db.sqlite
    database.path = .
    DEPLOYMENT += database

    My db open routine:

    bool DatabaseManager:penDB()
    // Find QSLite driver
    db = QSqlDatabase::addDatabase("QSQLITE");
    // http://doc.trolltech.com/4.5/sql-driver.html#qsqlite

    QString path(QDir::home().path());
    path = QDir::toNativeSeparators(path);

    // Open databasee
    return db.open();

    The file in question (mydb.db.sqlite) is at the same directory level as the pro file.

    What am I missing here?


  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Minnesota, USA

    Re: Deploying sqlite db file to N8 fails (can never find db file)

    Looks good offhand. Try printing out the final path name (as a label, or with qDebug) and see if it appears to be correct.

    I've used this for opening a DB:
        QString dbName("SampleDB.db");
        QFileInfo info(dbName);
        QString absoluteName;
        absoluteName = QDir::toNativeSeparators(info.absoluteFilePath());

Similar Threads

  1. Creating .sisx file including images,xml,db file
    By chandan444ever in forum Symbian
    Replies: 2
    Last Post: 2010-05-27, 10:29
  2. Is there any way to open DB file?
    By yugandhar.pathi in forum Symbian
    Replies: 1
    Last Post: 2008-11-06, 09:12
  3. Help!How to convert pc db file into symbian db
    By yaohongwang in forum Symbian
    Replies: 2
    Last Post: 2008-06-18, 09:52
  4. about .db editor on pc or vb connect .db file
    By kingqq007 in forum Symbian
    Replies: 2
    Last Post: 2008-01-29, 14:13
  5. Creation db file
    By silviuccia in forum Symbian
    Replies: 0
    Last Post: 2007-01-30, 10:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts