PDA

View Full Version : examining an sqlite db file created by QSqlDatabase



gmseed
16th October 2009, 14:55
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

Lykurg
16th October 2009, 16:54
//...
QSqlDatabase::addDatabase(driverType);
mDatabase.setDatabaseName(dbName);
//...
Please use the [ CODE ] tags if you post source code. Further it should be complete! In your case:

mDatabase = 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?

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.