Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QT VS TOOLS - "QODBC3: Unable to connect", "[Microsoft][Driver Manager ODBC]
Forum Updated to NodeBB v4.3 + New Features

QT VS TOOLS - "QODBC3: Unable to connect", "[Microsoft][Driver Manager ODBC]

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
5 Posts 3 Posters 4.4k Views 2 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.
  • elicatE Offline
    elicatE Offline
    elicat
    wrote on last edited by
    #1

    I'm not working I do not connect to the database access via QT VS TOOLS in visual Studio.
    For use QtWebEngine i work in VS2017 Community d Qt VS Tools.
    I have testing driver ODBC with service connect database with into a string connection and all it's ok
    My project into QT it connects. Into Vs 2017 i have error:

    QSqlError("0", "QODBC3: Unable to connect", "[Microsoft][Driver Manager ODBC] Nome origine dati non trovato e driver predefinito non specificato.")
    

    This is connect in VS 2017 thai i try inserting name file fix.

    db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=C:\folderdatabase\namedatabase.mdb");
    

    This is connect in QT that work

    db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=" + path_and_name_db);
    

    Saluti, Gianfranco Elicat

    1 Reply Last reply
    0
    • G Offline
      G Offline
      Gerd
      wrote on last edited by Gerd
      #2

      You should not use '\' within Strings!!

      change
      db.setDatabaseName("DRIVER={Microsoft Access Driver (.mdb)};FIL={MS Access};DBQ=C:\folderdatabase\namedatabase.mdb");
      to
      db.setDatabaseName("DRIVER={Microsoft Access Driver (
      .mdb)};FIL={MS Access};DBQ=C:\\folderdatabase\\namedatabase.mdb");
      or
      db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=C:/folderdatabase/namedatabase.mdb");

      and it should work

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mchinand
        wrote on last edited by
        #3

        If the filename separator issue doesn't fix your problem, it could be an issue with the version of the ODBC drivers you have installed. It's been a while since I've used ODBC with an Access file, but I remember that I was not able to connect to an Access database file with a 64-bit application when I had 32-bit MS Office (and 32-bit MS ODBC drivers) installed. I can't remember the exact error, but I remember that it wasn't immediately clear from the error message that this was the issue. There is a 64-bit version of the drivers you can download and install, but I don't think they co-existed well with the 32-bit versions still installed. There may be workarounds that I was not aware of. This might not even what is causing your problem.

        elicatE 1 Reply Last reply
        0
        • M mchinand

          If the filename separator issue doesn't fix your problem, it could be an issue with the version of the ODBC drivers you have installed. It's been a while since I've used ODBC with an Access file, but I remember that I was not able to connect to an Access database file with a 64-bit application when I had 32-bit MS Office (and 32-bit MS ODBC drivers) installed. I can't remember the exact error, but I remember that it wasn't immediately clear from the error message that this was the issue. There is a 64-bit version of the drivers you can download and install, but I don't think they co-existed well with the 32-bit versions still installed. There may be workarounds that I was not aware of. This might not even what is causing your problem.

          elicatE Offline
          elicatE Offline
          elicat
          wrote on last edited by
          #4

          @mchinand said in QT VS TOOLS - "QODBC3: Unable to connect", "[Microsoft][Driver Manager ODBC]:

          If the filename separator issue doesn't fix your problem, it could be an issue with the version of the ODBC drivers you have installed. It's been a while since I've used ODBC with an Access file, but I remember that I was not able to connect to an Access database file with a 64-bit application when I had 32-bit MS Office (and 32-bit MS ODBC drivers) installed. I can't remember the exact error, but I remember that it wasn't immediately clear from the error message that this was the issue. There is a 64-bit version of the drivers you can download and install, but I don't think they co-existed well with the 32-bit versions still installed. There may be workarounds that I was not aware of. This might not even what is causing your problem.

          I think the reason is just that.
          I installed Office 365 64bit and VisualStudio 2017 64bit
          I also looked for directions on how to check which version of odbc and it seems to be 64bit too.

          Do you know the method to be certain of which ODBC Access is installed? (the pc that I use business and many things were already present)

          Saluti, Gianfranco Elicat

          elicatE 1 Reply Last reply
          0
          • elicatE elicat

            @mchinand said in QT VS TOOLS - "QODBC3: Unable to connect", "[Microsoft][Driver Manager ODBC]:

            If the filename separator issue doesn't fix your problem, it could be an issue with the version of the ODBC drivers you have installed. It's been a while since I've used ODBC with an Access file, but I remember that I was not able to connect to an Access database file with a 64-bit application when I had 32-bit MS Office (and 32-bit MS ODBC drivers) installed. I can't remember the exact error, but I remember that it wasn't immediately clear from the error message that this was the issue. There is a 64-bit version of the drivers you can download and install, but I don't think they co-existed well with the 32-bit versions still installed. There may be workarounds that I was not aware of. This might not even what is causing your problem.

            I think the reason is just that.
            I installed Office 365 64bit and VisualStudio 2017 64bit
            I also looked for directions on how to check which version of odbc and it seems to be 64bit too.

            Do you know the method to be certain of which ODBC Access is installed? (the pc that I use business and many things were already present)

            elicatE Offline
            elicatE Offline
            elicat
            wrote on last edited by
            #5

            @elicat

            The problem is solved.
            Workaround:
            to install the 64-bit Access Database Engine 2010 on a computer with 32-bit Microsoft Office 2007, 2010, or 2013.

            Look this articles : How-to-install-64-bit-Microsoft-Database-Drivers-alongside-32-bit-Microsoft-Office

            Saluti, Gianfranco Elicat

            1 Reply Last reply
            1

            • Login

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