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. How use MS Access database on 64bit program with 32bit Office
Forum Updated to NodeBB v4.3 + New Features

How use MS Access database on 64bit program with 32bit Office

Scheduled Pinned Locked Moved Solved General and Desktop
microsoft accesbitnessdatabase driverdatabase odbc pmdb
2 Posts 1 Posters 704 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.
  • A Offline
    A Offline
    Alex Rus
    wrote on 31 Mar 2020, 22:32 last edited by Alex Rus
    #1

    Good day to all! I’ve been sitting on this task for SOME time and I don’t like creating topics myself, but I don’t find another option :
    Given:

    • My 64bit Windows program (Qt Creator 4.8.0, MinGW 64 compiler);
    • Target computer on 64bit Windows which may or may not include 32bit or 64bit Microsoft Office (any year);
    • Microsoft Access Database Engine 2010 (this version is needed - the file should work in 2010 version of the program).

    Task:
    My program should have the ability to read and modify data in .mdb database.

    Current solution:
    Use QSqlDatabase and QODBC:

    QSqlDatabase m_db = QSqlDatabase::addDatabase("QODBC");
    m_db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DSN='';DBQ=c:\\targetDB.mdb;");
    

    Problem:
    When 64bit Office and Access drivers are installed on the computer - everything works.
    However, if there is 32bit version of Office and Access - an error:
    [Driver Manager]Data source name not found, and no default driver specified QODBC3: Unale to connect

    • As far as I know, you can’t just install 64bit versions of MS Access drivers on PC with 32x office version;
    • But even if you do, it (spied here and here), when you try to connect / create a database or source data, an error pops up:
      alt text
    • Yes, I tried different options for the connection string;
    • I tried to Indicated a specific driver in the connection string - also did not help:
    m_db.setDatabaseName("DRIVER=С:\\*pathToAccesDrivers* \\ACEODBC.DLL;DBQ=c:\\targetDB.mdb;");
    

    So yeah, in total:

    • Is it possible to somehow use 64 drivers directly? Or correctly install both version (or 64x on 32x Office) Access Database Engine and use it?
    • Are there any other ways to work with .mdb files? I came across this code and the mention of some “CData Access Source”, but so far, I couldn't figure it out.
    • Any other ideas! Counting on you :>
    1 Reply Last reply
    0
    • A Offline
      A Offline
      Alex Rus
      wrote on 21 May 2020, 16:58 last edited by
      #2

      There was no solution, I had to sweat with the 32x version, which is installed if the Office is same bitness.

      1 Reply Last reply
      2

      • Login

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