Oppposite Workings of OLEDB/ODBC between Python and MS Access VBA

后端 未结 1 1477
暖寄归人
暖寄归人 2021-01-14 08:10

Fellow more advanced programmers:

Please forgive me if this seems like the tired Python 32-bit/64-bit ODBC/OLEDB Windows issue but I tried searching the forums and c

相关标签:
1条回答
  • 2021-01-14 09:06

    Short answer:

    Yes, to minimize headaches you should be running a 64-bit version of Python if you have 64-bit Office installed and you want to manipulate Access databases from Python.

    Longer answer:

    The older "Jet" engine/drivers and the newer Access Database Engine (a.k.a. "ACE") engine/drivers are completely separate entities.

    The older "Jet" drivers...

     ODBC: Driver={Microsoft Access Driver (*.mdb)}
    OLEDB: Provider=Microsoft.Jet.OLEDB.4.0  
    

    ... are installed as an integral part of the Windows OS but they only available to 32-bit applications.

    You have 64-bit Office installed, so you have the 64-bit version of the newer "ACE" drivers ...

     ODBC: Driver={Microsoft Access Driver (*.mdb, *.accdb)}
    OLEDB: Provider=Microsoft.ACE.OLEDB.12.0  
    

    ... and they are only available to 64-bit applications.

    Your current 32-bit Python environment can use the Jet drivers but not the ACE drivers

    You have the 64-bit version of Access, therefore your VBA code is running in the 64-bit universe and it can use the ACE drivers but not the Jet drivers.

    0 讨论(0)
提交回复
热议问题