[Interest] QSqlDatabase

Reinhardt Behm rbehm at hushmail.com
Wed Feb 4 15:22:40 CET 2015


On 04.02.2015 22:18, alexander golks wrote:
> Am Wed, 4 Feb 2015 15:01:50 +0100
> schrieb Till Oliver Knoll <till.oliver.knoll at gmail.com>:
>
>>
>>
>>
>>> ...
>>>     QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
>>> ...
>>>     bool ok = db.open();
>>>
>>> When I run this ok is always true, no matter what arguments are passed.
>> I am not experienced with SQLITE, but is it possible that each time a new DB instance (file) is created, if no such instance exists yet? Hence the "connection" alway succeeds?
>>
> or perhaps because sqlite has no notion of usernames, passwords, et al? just the "filename" matters.
So my (unreliable) memory tells me, too.
Also if you open a non-existing database, sqlite will just create an 
empty one.
Therefore your open() will always succeed irrespective of the arguments 
given.
-- 
Reinhardt






More information about the Interest mailing list