Connect to MS Access in Python

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 05:47:01

In both cases, the error message says it cannot find the driver (ODBC) or the provider (ADO).

In ODBC, are you sure that this driver is installed?

You can have a list of available drivers using pyodbc.drivers()

for example, in my case, I read MS Access data using this driver Microsoft Access Driver (*.mdb)

You probably have 32-bit Access (Office) and 64-bit Python. As you know, 32-bit and 64-bit are completely incompatible. You need to install 32-bit Python, or upgrade Access (Office) to 64-bit, and then it will work. Succinctly put, you cannot connect (at application level) a 64-bit Python.exe to a 32-bit MS Access ODBC driver (odbcad32.exe) since simply data is stored and processed differently between the types. However with backwards compatibility, it is advised to work in lowest common denominator as a 64-bit OS can run 32-bit applications and same level programs can "talk" to each other. Please take a look at the URL below for all details.

https://datatofish.com/how-to-connect-python-to-ms-access-database-using-pyodbc/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!