| Issue 30: | pyodbc.Error 'HYC00' | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1. Create a System DSN named gb with dbase driver by ODBC data source manager.
2. Open Python Interpreter;import pyodbc;
3. Call [[[ conn = pyodbc.connect("DSN=gb") ]]]
What is the expected output? What do you see instead?
see additional information.
What version of the product are you using? On what operating system?
pyodbc-2.1.3.win32-py2.6.exe & windows XP + SP2 Simplified Chinese
Please provide any additional information below.
================
>>> conn = pyodbc.connect("DSN=gb")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pyodbc.Error: ('HYC00', '[HYC00] [Microsoft][ODBC dBase
Driver]\xbf\xc9\xd1\xa1\
xb5\xc4\xb9\xa6\xc4\xdc\xce\xb4\xca\xb5\xcf\xd6 (106)
(SQLSetConnnectAttr(SQL_A
TTR_AUTOCOMMIT))')
>>>
================
Jan 31, 2009
> This is just a guess, but does the dbase driver not support transactions? Yes,I refer to some documents about dbase dirver 5.0 and your guess is correct. My Access driver work fine,does this mean that I should use Access instead of dbase?
Jan 31, 2009
I'm sorry, my example was exactly backwards! Autocommit is turned off by default, so
you need to set it true:
conn = pyodbc.connect('DSN=gb', autocommit=True)
The ODBC connection will start out with autocommit turned on. By passing True, you
tell pyodbc not to change it.
I apologize. Please try the above. (However, the access driver is pretty good, but
I believe dbase will work fine with the above change.)
Jan 31, 2009
All my problems are solved ,Thanks.
Mar 18, 2009
(No comment was entered for this change.)
Status:
Done
Nov 21, 2010
(No comment was entered for this change.)
Status:
Complete
|
This is just a guess, but does the dbase driver not support transactions? ODBC starts all drivers in autocommit mode, but the Python DB API specifies that Python database connections start in manual commit mode. Therefore, one of the first things pyodbc does when making a connection is set SQL_ATTR_AUTOCOMMIT to false. I'm guessing this is not supported. Try adding autocommit=False to your connection call: conn = pyodbc.connect('DSN=gb', autocommit=False)