Nominate our 2022 Qt Champions!

Connect to access data base in win32 and x64 with odbc driver

  • Hello,

    My Qt application designed on Win32 works fine to connect to an access database through odbc driver.
    Since, I generated this application with x64, so it cannot connect with the access database.


    • windows 7 pro
    • visual studio 2008
    • qt V4.6.2
    • toto.mdb is the access file generated by access 2003

    The win32 configuration files :

    • odbccad32 in Windows\SysWOW64 with odbcad32 that drives Microsoft Access Driver (*.mdb) Version 6.01.7601.17632
    • odbc32.dll in Windows\SysWOW64 v6.1.7601.17514
    • odbcint.dll in Windows\SysWOW64 v6.1.7600.16385
    • The qt dll plugins is:

    The x64 configuration files

    • I have installed Microsoft Access Database Engine 2010 Redistributable
    • odbccad32 in Windows\system32 with odbcad32 that drives Microsoft Access Driver (*.mdb, *.accdb) Version 14.00.4760.1000
    • odbc32.dll in Windows\system32 v6.1.7601.17514
    • odbcint.dll in Windows\system32 v6.1.7600.16385
    • The qt dll plugins is:
      @QString dbName;
      QSqlDatabase m_db;

    m_db = QSqlDatabase::addDatabase("QODBC");
    dbName = "DRIVER={Microsoft Access Driver (*.mdb)};DSN='';DBQ=toto.mdb";

    the source code
    qDebug() << "oK";
    qDebug() << m_db.lastError().text();

    Dll log is:

    • .\Debug\sqldrivers\qsqlodbcd4.dll is loaded
    • Windows\system32\odbc32.dll is loaded
    • Windows\system32\odbcint.dll is loaded

    Error log is :

    • Error in french: [Microsoft][Gestionnaire de pilotes ODBC] Source de données introuvable et nom de pilote non spécifié QODBC3: Unable to connect
      Error in english: [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified.

    Help please !

  • I solved this problem, and now my application generated wih x64 connects to Access Data Base.

    The name of the driver must be written exactly as you see on ODBC management: Windows\system32\odbccadd32. The ODBC driver for access shows : DRIVER={Microsoft Access Driver (*.mdb, *.accdb)

    source code
    @#ifdef _WIN64
    dbName = "DRIVER={Microsoft Access Driver (*.mdb, .accdb)}'';DBQ=toto.mdb";
    dbName = "DRIVER={Microsoft Access Driver (

    The driver odbc for access x64:

Log in to reply