drivers returns:
QSQLITE
QODBC3
QODBC
The code you requested is:
// Get the connection, if it exists
// Check that the driver is available
throw sqlE
(dbConn,
QObject::tr("The Database driver ")+ connType
+ QObject::tr("is not available"));
// Get the connection, if it exists
QSqlDatabase dbConn = QSqlDatabase::database(connName,false);
// Check that the driver is available
if (!QSqlDatabase::isDriverAvailable(connType))
throw sqlE(dbConn, QObject::tr("The Database driver ")+ connType + QObject::tr("is not available"));
To copy to clipboard, switch view to plain text mode
followed by:
// Okay the connection doesn't exist so let's add it using the appropriate driver type
// Okay the connection doesn't exist so let's add it using the appropriate driver type
dbConn = QSqlDatabase::addDatabase(connType,connName);
To copy to clipboard, switch view to plain text mode
The result is "... The Database driver QPSQLis not available"
Bookmarks