PDA

View Full Version : error while execution duplicate connection name



khadija123
13th April 2012, 10:37
hi
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

Spitfire
13th April 2012, 14: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.