Hi ,
I am using qt-win-commercial-4.4.3-vs2005 and integrated to MSVS2005 using qt-vsintegration-1.3.3 on windows. Now if I use to connect the sqlite database connection its working well.But if I use to connect the MYSQL connection its showing driver not loaded.I looked at" C:\Qt\4.4.3\plugins\sqldrivers" all the dll's are there.So now to make a MYSQL connection shall I have plugin it or what all I have to do for the package I am using.I also installed Mysql(MySQL Server 5.0)
please suggest me to get out of this problem.
The code I used to connect is shown below.
db.setDatabaseName( "data" );
if ( !db.open())
{
QMessageBox::information(0,
"",
"Failed to open database:"+ db.
lastError().
driverText());
qWarning( "Failed to open database: " + db.lastError().driverText() );
qWarning( db.lastError().databaseText() );
return 1;
}
QSqlDatabase db = QSqlDatabase::addDatabase( "QMYSQL" );
db.setDatabaseName( "data" );
if ( !db.open())
{
QMessageBox::information(0,"","Failed to open database:"+ db.lastError().driverText());
qWarning( "Failed to open database: " + db.lastError().driverText() );
qWarning( db.lastError().databaseText() );
return 1;
}
To copy to clipboard, switch view to plain text mode
Regards,
Sudheer.
Bookmarks