Defining QSqlQuery you specify the database to which it relates, eg
Qt Code:
  1. QSqlQuery qry(db2);
To copy to clipboard, switch view to plain text mode