“未找到数据源名称且未指定默认驱动程序"使用访问 ODBC [英] "Data source name not found and no default driver specified" with Access ODBC
问题描述
我的软件:
- Python 3.4 -64 位
- PyODBC 64 位
- 已安装 MS Office 软件包(32 位)
问题:
现在,我尝试使用 PYODBC 访问安装在我计算机上的 MS Access 2010.无论我尝试什么,它都不起作用.我的错误总是这样:
Now, I try to access MS Access 2010 installed in my computer using PYODBC. It does not work regardless of what I try. My error is always this:
pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
我已经看过了:
建议是 32-64 位问题,我确定是.是否可以进行一些修改以使其在不安装 32 位 python 和 32 位 pyodbc 的情况下工作?我检查了这个网站.在 64 上使用 ODBC(32 位和 64 位)-bit Windows 解释了如何访问控制面板以修改 ODBC 连接和/或驱动程序.但是,我对 Windows 数据库连接内部结构了解不多,无法开始一些更改.
It is suggested that it is 32-64 bit problem which I am sure it is. Is there some modification that can be done to make it work without installing 32 bit python and 32 bit pyodbc? I checked this website.Using ODBC (32-bit and 64-bit) on 64-bit Windows which explains about accessing the control panel to modify ODBC connnection and/or drivers. However, I don't know much about windows database connection internals to commence some changes.
有什么我可以做的事情吗?
Is there something that I can do to make it work?
推荐答案
是否可以进行一些修改以使其在不安装 32 位 python 和 32 位 pyodbc 的情况下工作?
Is there some modification that can be done to make it work without installing 32 bit python and 32 bit pyodbc?
不是真的.如果您安装了 32 位 Office,那么您就有了 32 位版本的 Access 数据库引擎(又名ACE"),并且只有 32 位应用程序可以使用它.
Not really. If you have 32-bit Office installed then you have the 32-bit version of the Access Database Engine (a.k.a. "ACE"), and only 32-bit applications can use it.
如果检测到 32 位 Office 组件,则 64 位版本的 Access 数据库引擎安装程序将中止.有一种方法可以强制安装程序继续,但不建议这样做,因为它显然会破坏 Office.
The installer for the 64-bit version of the Access Database Engine will abort if it detects 32-bit Office components. There is a way to force the installer to continue, but that is not recommended because it can apparently break Office.
底线:您的应用程序的位数"必须与安装的 Access 数据库引擎的位数"相匹配.因此,实际上,您的选择是
Bottom Line: The "bitness" of your application must match the "bitness" of the installed Access Database Engine. So, practically speaking, your options are
- 使用 32 位 Python 和 pyodbc,或
- 将 32 位 Office 替换为 64 位版本.
这篇关于“未找到数据源名称且未指定默认驱动程序"使用访问 ODBC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!