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 30: pyodbc.Error 'HYC00'
1 person starred this issue and may be notified of changes. Back to list
Status:  Complete
Owner:  ----
Closed:  Mar 2009


 
Reported by notm...@gmail.com, Jan 29, 2009
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))')
>>>
================


odbc.jpg
33.6 KB   View   Download
Jan 29, 2009
Project Member #1 mkleehammer
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)

Status: Investigating
Jan 31, 2009
#2 notm...@gmail.com
> 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?
dbaseODBC.jpg
43.2 KB   View   Download
Jan 31, 2009
Project Member #3 mkleehammer
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
#4 notm...@gmail.com
All my problems are solved ,Thanks.
Mar 18, 2009
Project Member #5 mkleehammer
(No comment was entered for this change.)
Status: Done
Nov 21, 2010
Project Member #6 mkleehammer
(No comment was entered for this change.)
Status: Complete

Powered by Google Project Hosting