View Full Version : error while execution duplicate connection name

13th April 2012, 11:37
could you help me with this error :
when i compile it's all good but while the execution i get this messsage
QSqlDatabasePrivate::addDatabase: duplicate connection name 'qt_sql_default_connection', old connection removed.
and the programm stops the execution

13th April 2012, 15:59
If you want to have multiple database connections, name them when calling QSqlDatabase::addDatabase( "name" ) and then retreive them via QSqlDatabase::database( "name" ).
If you use only single connection then use QSqlDatabase::addDatabase() only once and later retreive it via QSqlDatabase::database().

Read manual for QSqlDatabase::database() and QSqlDatabase::addDatabase() for more info.