[Qt-interest] SQLite and create new database file
Constantin Makshin
dinosaur-rus at users.sourceforge.net
Mon Jan 19 00:37:29 CET 2009
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(fileName);
db.open();
On Mon, 19 Jan 2009 01:16:30 +0300, Robert Hairgrove
<evorgriahr at hispeed.ch> wrote:
> According to the docs of SQLite, if one tries to open a database file
> which doesn't exist, a new one by that name is created.
>
> It appears that Qt doesn't play along these lines. I added a database,
> then tried to open it. No error was issued, but no new database file was
> created, either.
>
> How can I create a new SQLite database by using
> QSqlDatabase::addDatabase()?
>
> Is it possible by some other means (from within the Qt application, that
> is)?
--
Constantin "Dinosaur" Makshin
More information about the Qt-interest-old
mailing list