Results 1 to 2 of 2

Thread: examining an sqlite db file created by QSqlDatabase

  1. #1

    Default examining an sqlite db file created by QSqlDatabase

    I set up an SQLITE db in Qt via:

    //...
    QSqlDatabase::addDatabase(driverType);
    mDatabase.setDatabaseName(dbName);
    //...

    but can't seem to find the db file afterwards.

    Does anyone know where QT places the sqlite files so that I can query it via the sqlite command-line tool?

    Cheers

    Graham

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: examining an sqlite db file created by QSqlDatabase

    Quote Originally Posted by gmseed View Post
    //...
    QSqlDatabase::addDatabase(driverType);
    mDatabase.setDatabaseName(dbName);
    //...
    Please use the [ CODE ] tags if you post source code. Further it should be complete! In your case:
    Qt Code:
    1. mDatabase = QSqlDatabase::addDatabase(driverType);
    2. mDatabase.setDatabaseName(dbName);
    To copy to clipboard, switch view to plain text mode 
    but can't seem to find the db file afterwards.

    Does anyone know where QT places the sqlite files so that I can query it via the sqlite command-line tool?
    Yes, me you set the path via dbName/QSqlDatabase::setDatabaseName(). If it is only a file name, then it is located under the current working directory of your application. Look there.

Similar Threads

  1. Releasing database file with QSqlDatabase
    By JPNaude in forum Qt Programming
    Replies: 24
    Last Post: 24th May 2011, 09:33
  2. Sqlite & QSqlDatabase problem
    By rsimone in forum Newbie
    Replies: 5
    Last Post: 29th July 2009, 21:52
  3. qt how to connect to sqlite db file
    By TomASS in forum Qt Programming
    Replies: 2
    Last Post: 22nd April 2009, 09:47
  4. QSqlDataBase file not found
    By sdastagirmca in forum Qt Programming
    Replies: 3
    Last Post: 5th February 2009, 07:53
  5. Replies: 3
    Last Post: 27th December 2008, 19:34

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.