QSqlDatabase with Ms Access database
Solved
General and Desktop
-
hi:
I tested a simple code in Win 7 (Qt 5.7 with MingGW 5.30 (32 bit)).QSqlDatabase msAccess = QSqlDatabase::addDatabase("QODBC"); QString sPath = QCoreApplication::applicationDirPath() + "/Database/Data.mdb"; msAccess.setDatabaseName("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DSN='';DBQ="+ QDir::toNativeSeparators(sPath)); msAccess.open(); if(msAccess.isOpen()) { this->setWindowTitle("Open"); } else { this->setWindowTitle(msAccess.lastError().text()); }
The Apps work in release mode in the Win 7 PC but not in Win Xp.
Error : [Microsoft][ODBC Driver Manager]Data Source name not found and no default driver specified QODBC3: Unable to Connect"
I have Ms Access 2003 installed on Win XP PC, so I doubt is the driver.
Any body face the same error like this?
Thks