Qt Access 2007
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
QString accessFile = QCoreApplication::applicationDirPath() + "/resource/Database.accdb";
QString dsn = QString("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};FIL={MS Access};DBQ=%1").arg(accessFile);
db.setDatabaseName(dsn);
值得注意的是数据库文件*.accdb路径必须为绝对路径