[python-win32] dbi module deprecated at 2.5. What to use in its place in 2.5, 2.6, and 3.0?

Vernon Cole vernondcole at gmail.com
Wed Jul 8 16:14:34 CEST 2009


odbc is compliant with PEP 248, the db api specification v1.0. PEP 248 has
been superseded by PEP 249 which is version 2.0 of the db api specification.
adodbapi is fully compliant with PEP 249.

You may want to consider using the newer version in your new work. Or, if
you don't wish to use any of the newer features of PEP 249, you can keep
using the old one. Both are part of pywin32 and will be maintained for the
foreseeable future.

The other difference between them is that odbc is implemented in C code,
while adodbapi is pure Python and uses the heavier Microsoft ADO interface,
and therefore may be slightly slower. ADO is fussy about re-using a cursor,
you have to close the old one and open a new one for each transaction. On
the other hand, perhaps re-using cursors is why odbc seemed to crash
sometimes for me. YMMV.
--
Vernon Cole

On Wed, Jul 8, 2009 at 6:31 AM, Mark Hammond <skippy.hammond at gmail.com>wrote:

> On 8/07/2009 9:19 PM, Dana N wrote:
>
>> I have a variety of Python 2.4 scripts that utilitize the dbi and odbc
>> modules together. Although I don't have Python 2.5, I've been informed
>> the dbi module has been deprecated at pywin32 2.5.
>> What do I use in place of dbi for my Python 2.4 scripts that
>> import modules dbi and odbc together.I don't use DBI directly. It was
>> simply a dependency for the odbc module as best I knew.
>> We're still using pywin32 2.5 because that's what our software vendor
>> (ESRI / ArcGIS Desktop 9.3) supports.
>>
>
> dbi and odbc have been integrated - if you don't directly use dbi, just
> stop importing it, and eventually you will never notice it going away. If
> you do use it directly, everything you used is now available directly in the
> odbc module.
>
> Cheers,
>
> Mark
> \
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20090708/21e24970/attachment.htm>


More information about the python-win32 mailing list