I'm on windows 8 using Qt 4.7.4 (dont ask why :p)
I'm trying to connect to an Access database using this lines of code
db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};FIL={MS Access};DBQ=MSG.accdb");
if (db.open()) {
qDebug() << "connected";
return true;
}
else
{
QSqlError error = db.lastError();
qDebug() << error.databaseText();
qDebug() << error.driverText();
return false;
}
Of course it doesn't connect and IQ get the following:
Application "C:\Program Files (x86)\Common Files\Microsoft Shared\office14\mso.dll" not found in cache
"[Microsoft][Pilote ODBC Microsoft Access] Nom de fichier incorrect."
"QODBC3: Unable to connect"
the file MSG.accdb is just at the root of the build folder
I checked the the folder "C:\Program Files (x86)\Common Files\Microsoft Shared\office14\" and I found the MSO.DLL file there.