The ODBC module distributed with PythonWin is a minimal implementation, and conforms to Version 1.0 of the Python Database API. It’s stable and works well, but is unlikely to be developed further. Then again, neither is ODBC!
If you work extensively with
databases, check out
package, available from
of its many features is an enhanced set of date and time types to
save you from worrying about Microsoft and Unix date systems. These
are available as a separate package,
which can be used in nondatabase applications.
mxODBC also runs on Unix.
has some licensing
restrictions; check the web site for the latest details.
are both shipped as
packages that should be unzipped somewhere on the Python
path. The latter creates
a directory and package named—you guessed it—ODBC. There
collision with the old ODBC module, which lives in
...Python\win32\odbc.pyd ; we suggest renaming
this to something else, such as win32odbc.pyd,
so that you can still access the old module if you want to (note,
however, that you need to rename the module back to the original
odbc.pyd before it can be used again). It
contains a number of subpackages aimed at other platforms; the
functionality we want is in the module
. Let’s give it a try:
>>> import ODBC.Windows >>> conn = ODBC.Windows.Connect('PYDBDEMOS') >>> cursor ...