QT连接64位ACCESS数据库
作者:互联网
QSqlDatabase db;
db = db.addDatabase("QODBC");
QString path("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};FIL={MS Access};DBQ=D:\\QT\\first\\build-Thread-Desktop_Qt_5_9_0_MSVC2013_64bit-Debug\\test.mdb");
db.setDatabaseName(path);
if (db.open())
{
// success!
qDebug() << "Success";
}
else{
qDebug() << "Errror!";
qDebug() << db.lastError().text();
QSqlError error = db.lastError().text();
QMessageBox::information(NULL,"提示",error.text(),QMessageBox::Yes|QMessageBox::No,QMessageBox::Yes);
db.close();
}
标签:Access,QT,mdb,text,db,ACCESS,64,QMessageBox,qDebug 来源: https://blog.csdn.net/a963216_/article/details/122375891