Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. ODBC driver loaded but unavailable

ODBC driver loaded but unavailable

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 488 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Match0umM Offline
    Match0umM Offline
    Match0um
    wrote on last edited by
    #1

    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

    Ketan__Patel__0011K 1 Reply Last reply
    0
    • Match0umM Match0um

      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

      Ketan__Patel__0011K Offline
      Ketan__Patel__0011K Offline
      Ketan__Patel__0011
      wrote on last edited by Ketan__Patel__0011
      #2

      @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

      1 Reply Last reply
      2
      • Match0umM Offline
        Match0umM Offline
        Match0um
        wrote on last edited by
        #3

        Hi @Ketan__Patel__0011

        Thanks for your help !

        I did it, following carefully steps from below link !!
        https://wiki.qt.io/Handling_Microsoft_Excel_file_format

        But 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

        Ketan__Patel__0011K 1 Reply Last reply
        1
        • Match0umM Match0um

          Hi @Ketan__Patel__0011

          Thanks for your help !

          I did it, following carefully steps from below link !!
          https://wiki.qt.io/Handling_Microsoft_Excel_file_format

          But 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

          Ketan__Patel__0011K Offline
          Ketan__Patel__0011K Offline
          Ketan__Patel__0011
          wrote on last edited by
          #4

          @Match0um
          Happy to help
          best of luck for your projects.
          cheers

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved