Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
632 views
in Technique[技术] by (71.8m points)

python - "Data source name not found and no default driver specified" with Access ODBC

My Softwares:

  • Python 3.4 -64 bit
  • PyODBC 64 bit
  • MS office package Installed (32 bit)

Problem:

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)')

I already looked at:

pyodbc and ms access 2010 connection error

Cannot connect to Access DB using pyodbc

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Is there some modification that can be done to make it work without installing 32 bit python and 32 bit pyodbc?

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.

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.

Bottom Line: The "bitness" of your application must match the "bitness" of the installed Access Database Engine. So, practically speaking, your options are

  1. Use 32-bit Python and pyodbc, or
  2. replace your 32-bit Office with the 64-bit version.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...