My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 34: connection to excel fle using pyodbc fails
1 person starred this issue and may be notified of changes. Back to list
Status:  NoFix
Owner:  ----
Closed:  Mar 2009


 
Reported by chris.le...@googlemail.com, Feb 12, 2009
What steps will reproduce the problem?
1. set up an Excel file as a SystemDSN using Microsoft Excel Driver
2. try to connect using pyodbc.connect('DSN=<source>')
3.

What is the expected output? What do you see instead?
pyodbc.Error:('HYC00','[HYC00][Microsoft][ODBC Excel Driver]Optional 
feature not implemented (106) (SQLSetConnectAttr(SQL_ATTR_AUTOCOMMIT))')

What version of the product are you using? On what operating system?
pyodbc 2.1.2, Python 2.5.1, Excel 2002, Windows XP

Please provide any additional information below.

I get the same result using autocommit=False in the connection string, and 
using a dsn-less connection string for the same file

Feb 12, 2009
Project Member #1 mkleehammer
You need to use autocommit=True, actually.

ODBC drivers default to autocommit, but the Python DB API specification requires it
to be turned off.  So the first thing pyodbc does is turn *off* autocommit -- and
this is what the Excel driver does not support.  If you set the flag to True, pyodbc
sees there is nothing to do (the driver is already in autocommit mode).

I'll write something about this in a couple of the Wiki pages.
Status: Investigating
Feb 12, 2009
#2 chris.le...@googlemail.com
Thanks for the quick response. When I use pyodbc.connect
('DSN=<source>;autocommit=True') I get exactly the same error. Am I missing 
something?
Feb 12, 2009
Project Member #3 mkleehammer
The autocommit is not part of the connection string, but is a separate keyword:

cnxn = pyodbc.connect('DSN=<source>', autocommit=True)

Mar 9, 2009
Project Member #4 mkleehammer
(No comment was entered for this change.)
Status: Invalid
Nov 21, 2010
Project Member #5 mkleehammer
(No comment was entered for this change.)
Status: NoFix

Powered by Google Project Hosting