ODBC driver loaded but unavailable
-
Hello all,
Trying to start with excel file reading through Qt app, but I am struggling with driver opening -_-
void MainWindow::parcourir(){ QSqlDatabase db = QSqlDatabase::addDatabase("QODBC", "xlsx_connection"); qDebug()<<"drivers disponibles" << db.drivers(); db.setDatabaseName("DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)}; DBQ=" + QString("C:\\test.xlsx")); if(db.open()) { qDebug() << "ok"; } else{ qDebug()<<"db.open = false "<< db.lastError().text(); } }
Application output =>
"
drivers disponibles ("QSQLCIPHER", "QSQLITE", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3", "QPSQL", "QPSQL7")db.open = false "Le pilote spécifié n'a pas été chargé en raison de l'erreur système 126: Le module spécifié est introuvable. (Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb), C:\Program Files\Microsoft Office\root\VFS\ProgramFilesCommonX64\Microsoft Shared\Office16\ACEODBC.DLL). QODBC3: Unable to connect"
"So I looked for the specified driver which is obsiously not there...
My question is:
Does anyone know who is giving this bad path ??
I looked into registry but nothing like this :(thanks for your help
-
Hello all,
Trying to start with excel file reading through Qt app, but I am struggling with driver opening -_-
void MainWindow::parcourir(){ QSqlDatabase db = QSqlDatabase::addDatabase("QODBC", "xlsx_connection"); qDebug()<<"drivers disponibles" << db.drivers(); db.setDatabaseName("DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)}; DBQ=" + QString("C:\\test.xlsx")); if(db.open()) { qDebug() << "ok"; } else{ qDebug()<<"db.open = false "<< db.lastError().text(); } }
Application output =>
"
drivers disponibles ("QSQLCIPHER", "QSQLITE", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3", "QPSQL", "QPSQL7")db.open = false "Le pilote spécifié n'a pas été chargé en raison de l'erreur système 126: Le module spécifié est introuvable. (Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb), C:\Program Files\Microsoft Office\root\VFS\ProgramFilesCommonX64\Microsoft Shared\Office16\ACEODBC.DLL). QODBC3: Unable to connect"
"So I looked for the specified driver which is obsiously not there...
My question is:
Does anyone know who is giving this bad path ??
I looked into registry but nothing like this :(thanks for your help
@Match0um
Easy and fast solution is Install AccessDatabaseEngine Software in your system.Follow the link for download
https://www.microsoft.com/en-us/download/details.aspx?id=54920 -
Thanks for your help !
I did it, following carefully steps from below link !!
https://wiki.qt.io/Handling_Microsoft_Excel_file_formatBut it forwards to a 2010 version I carelessly installed -_-
With 2016 version, works like a charm ! :D
ps: engine hard to install as .32 version said I needed a 64, and .64 advised a .32 -_-
running the .64 in command line with /quiet get me out of this.Hope it could help.
cheers -
Thanks for your help !
I did it, following carefully steps from below link !!
https://wiki.qt.io/Handling_Microsoft_Excel_file_formatBut it forwards to a 2010 version I carelessly installed -_-
With 2016 version, works like a charm ! :D
ps: engine hard to install as .32 version said I needed a 64, and .64 advised a .32 -_-
running the .64 in command line with /quiet get me out of this.Hope it could help.
cheers@Match0um
Happy to help
best of luck for your projects.
cheers