2

I use this code to connect to Access 2013:

conn_str = r"Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\_DELOITTE\Statistics.mdb;"
self.conn = pyodbc.connect(conn_str)

I get the following error:

pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')

I use Windows 8, Intel processor, 32-bit Access, and Python 2.7.

In Administrative Tools I have ODBC Data Sources (32-bit) and ODBC Data Sources (64-bit) both pointing at %windir%\system32\odbcad32.exe. Only "System DSN" is filled in, but no "User DSN".

System DSN

1 Answer 1

4

This could be incompatibility if you are using 64bit Python. I just tested something similar on my machine.

This isn't conclusive since these are different versions of Python, but it is a lead to follow. Here's what I tested:

32bit Python 2.7, on a 32bit MS Access driver. Connection successful, no errors.

64bit Python 3.4, on a 32bit MS Access driver. Returned Error: "pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source na me not found and no default driver specified (0) (SQLDriverConnect)')"

Sign up to request clarification or add additional context in comments.

6 Comments

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. - From Review
Actually. It can provide an answer to the question, if the OP is using 64bit Python. Given that I cannot comment on the OP's question (due to lack of rep), how else am I to determine if the OP is using a 64bit or 32bit Python?
Get more rep or use chat.
It is only your opinion that this is not an answer, however, this is a plausible solution to the problem that the OP is having, with potential evidence of its effect. If, for some reason, the OP comes back and determines that this is not a plausible solution, I will of course delete it.
Yes, I use Python 64-bit! I will try to get Python 32-bit and ee if the connection works.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.