[Qt-interest] connect mysql

Bob Hood bhood2 at comcast.net
Wed Sep 14 15:47:18 CEST 2011


On 9/14/2011 12:32 AM, pengliang(彭亮) wrote:
>
> Hello
>
> I don’t know why application always output that information. Anybody could
> tell me why.
>
> --------------------------------- snippets
>
> query.clear();
>
> f5ErpDb.close();
>
> f5ErpDb.removeDatabase("QODBC");
>
> camMysqlDb=QSqlDatabase::addDatabase("QMYSQL");
>
> ------------------- application output
>
> QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection'
> is still in use, all queries will cease to work.
>
> QSqlDatabasePrivate::addDatabase: duplicate connection name
> 'qt_sql_default_connection', old connection removed.
>


I believe the Qt documentation clearly explains why you are seeing these
messages. Try wrapping your queries inside a code block to make sure they go
fully out of scope before you remove the database.


Render me gone,                       |||
Bob                                 ^(===)^
---------------------------------oOO--(_)--OOo---------------------------------
   "One of the penalties for refusing to participate in politics is that you
           end up being governed by your inferiors." -- /Plato/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110914/019f597c/attachment.html 


More information about the Qt-interest-old mailing list