i wrote following code....
QSqlDatabase db=QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("new.db");
but i couldn't find the database in that folder.....is it not creating the database or the code is wrong????please help..........
i wrote following code....
QSqlDatabase db=QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("new.db");
but i couldn't find the database in that folder.....is it not creating the database or the code is wrong????please help..........
If memory serves, Sqlite file will not create the actual file until after you create tables in it.
Perhaps the QSqlDatabase driver for SQLITE has this behavior, but the sqlite3 command line program will create an empty database as long as you do something that opens the database:
Qt Code:
sqlite3 test.sqlite "select * from sqlite_master"To copy to clipboard, switch view to plain text mode
The above on a non-existent database will result in zero byte file being created.
Bookmarks