Results 1 to 2 of 2

Thread: error while execution duplicate connection name

  1. #1
    Join Date
    Mar 2012
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default error while execution duplicate connection name

    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

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: error while execution duplicate connection name

    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.

Similar Threads

  1. Replies: 2
    Last Post: 9th February 2011, 09:33
  2. Replies: 1
    Last Post: 16th June 2010, 20:19
  3. Execution error
    By Shuchi Agrawal in forum Installation and Deployment
    Replies: 10
    Last Post: 9th February 2007, 12:12
  4. Qtopia example execution error(application hangs)
    By devendra in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th October 2006, 09:11
  5. Replies: 3
    Last Post: 22nd June 2006, 16:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.