There doesn't seem to be any part that says "this QSqlQuery operates on this QSqlDatabase".
Printable View
There doesn't seem to be any part that says "this QSqlQuery operates on this QSqlDatabase".
There are variations on how you can do this, but the basics are:
1. define database
2. define query
Sqlite example:
Code:
// define database db.setDatabaseName(dbName + ".sqlite"); db.open(); // define query query.exec("SELECT * from yourTable");
If you split this code into two pieces then you can use the connectionName and don't have to re-define the database for each query.