| Issue 166: | not able to connect excel 2007 files *.xlxs | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1.>>>import pyodbc
2.>>>conn=pyodbc.connect('DRIVER={Microsoft Excel Driver (*.xlsx)};DBQ=D:\\test.xlsx',autocommit=True)
3.
What is the expected output? What do you see instead?
i got the error:
Traceback (most recent call last):
File "<pyshell#28>", line 1, in <module>
conn=pyodbc.connect('DRIVER={Microsoft Excel Driver (*.xlsx)};DBQ=D:\\test.xlsx',autocommit=True)
Error: ('IM002', '[IM002] [Microsoft][ODBC \xc7\xfd\xb6\xaf\xb3\xcc\xd0\xf2\xb9\xdc\xc0\xed\xc6\xf7] \xce\xb4\xb7\xa2\xcf\xd6\xca\xfd\xbe\xdd\xd4\xb4\xc3\xfb\xb3\xc6\xb2\xa2\xc7\xd2\xce\xb4\xd6\xb8\xb6\xa8\xc4\xac\xc8\xcf\xc7\xfd\xb6\xaf\xb3\xcc\xd0\xf2 (0) (SQLDriverConnectW)')
What version of the product are you using? On what operating system?
it works well for *.xls files but why can't i connect *.xlsx?
Please provide any additional information below.
Mar 22, 2011
Thank you!
You are right, I should use {Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)} to connect .xlsx files
While previously i guess the name {Microsoft Excel Driver (*.xls, *.xlsx)}, or {Microsoft Excel Driver (*.xlsx)}, they are all incorrect.
May 20, 2011
(No comment was entered for this change.)
Status:
NoFix
|
I cannot find an ODBC driver named "Microsoft Excel Driver (*.xlsx)", not even with a Google search. Do you really have a driver by that name installed, or are you guessing the name? Installed drivers are shown on the "Driver" tab of the ODBC Data Source administrator, accessed via: - Start menu -> Run -> odbcad32.exe -> OK - for 32-bit drivers on 64-bit OS: Start menu -> Run -> c:\windows\syswow64\odbcad32.exe -> OK With Office 2010 installed, I can see the following drivers: {Microsoft Excel Driver (*.xls)} {Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)}