Are you using Python 2.4?. If so and if you can, try using Python 2 5?.
The problem you report existed as a ticket in the old Source Forge bug
tracker and the last discoverings made were that it was an error that
affected only pyodbc 2.0.5x and 2.0.6x versions running under Python
2.4.
If you can't move away from 2.4 you could try the following:
I had pasted a patch for these versions of pyodbc created from the
comments posted to that ticket by people that knows a lot more about the
Python C API to than I do:
Luckily I could recover the link to pastebin from one of the comments
posted at django-pyodbc issue 17:
http://code.google.com/p/django-pyodbc/issues/detail?can=1&id=17
as no trace of the pyodbc project remains on SourceForge and the issue
hasn't (yet) been ported to the new issue tracker at Google code.
A very strange problem if you ask me, I've searched the Python 2.5
changes documents trying to find something that could explain this
without success.
HTH,
--
Ramiro Morales