[Qt-interest] 答复: [?? Probable Spam] Re: Can not load qsqlite4.dll
Bill King
bill.king at nokia.com
Wed Oct 21 02:57:44 CEST 2009
I think there's a confusion somewhere. the addDatabase will fail if the
driver is not loaded.
the open will fail for another reason. invalid path? read only path?
something to do with sqlite itself that's not allowing the db to be opened.
On 10/21/2009 10:21 AM, ext 吴海峰 wrote:
>
> If I do not load the plugin, the open() method will fail.
>
> QSqlDatabase db = QsqlDatabase::addDatabase("QSQLITE", "conn1");
>
> db.setDatabaseName(str_db_file_name);
>
> qDebug() << db.open();
>
> It produces that the open() will fail.
>
> *发件人:* Bill King [mailto:bill.king at nokia.com]
> *发送时间:* 2009年10月21日 8:02
> *收件人:* 吴海峰
> *抄送:* Qt-interest at trolltech.com
> *主题:* [?? Probable Spam] Re: [Qt-interest] Can not load qsqlite4.dll
>
> On 10/21/2009 12:45 AM, ext 吴海峰 wrote:
>
> Hello everybody.
>
> I have a problem described below.
>
> I use QPluginLoader to load qsqlite4.dll without success. (The
> executable is deployed in a new installed XP System.)
>
> I use VS2005 and Qt4.5.2.
>
> QString str_abs_path_to_sqlite("D:/qsqlite4.sql"); // it does exist.
>
> QPluginLoader *pLoader = new QPluginLoader(str_abs_path_to_sqlite);
>
> if(pLoader->load() == false)
>
> {
>
> qDebug() << pLoader->errorString();
>
> }
>
> In logfile, it proves that it enters into the " qDebug() <<
> pLoader->errorString();" logic.
>
> It says "Program is not installed correct. Reinstalling it may fix the
> problem" which indicated that manifest
>
> file is missing. But sqlite module is compiled in plugin mode and it
> embeds the mainfest already. Why it still produce the error above? I
> can not load qsqlite4.dll now.
>
> Plz help me out. Any suggestions and ideas are welcome. Thanks in advance.
>
> BTW, I have search the list but without luck.
>
> Err, why are you manually loading the sqlite4 plugin?
>
>
> QSqlDatabase::addDatabase() should handle that automatically for you...
> eg: QSqlDatabase db=QSqlDatabase::addDatabase("QSQLITE", "sqlite db");
>
> --
> Bill King, Software Engineer
> Qt Development Frameworks, Nokia Pty Ltd
> Brisbane Office
--
Bill King, Software Engineer
Qt Development Frameworks, Nokia Pty Ltd
Brisbane Office
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091021/302fd139/attachment.html
More information about the Qt-interest-old
mailing list