My application uses Qt SQL in this way
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};DBQ="+QDir::currentPath()+"/database.mdb");
and everything else is done with QSqlRelationalTableModel.
Now that the deployment phase has begun, the application works fine on the system where Qt (4.6.3) is installed, but on another clean system this error occurs when loading the database
"Driver not loaded"
I know this has to do with copying ODBC plugins ... but just copying qsqlodbc4.dllto the application directory and
qApp->addLibraryPath(QDir::currentPath());
does not work!!
What is the solution for this ?
Note. The application is not associated with the driver DLL, it uses the Qt plugin mechanism.
source
share