Using MyODBC with Python

Steve Holden sholden at holdenweb.com
Wed May 1 18:08:11 EDT 2002


"Joseph A Knapka" <jknapka at earthlink.net> wrote in message
news:3CD06255.946D84E2 at earthlink.net...
> Steve Holden wrote:
>
> > that). You could use the one that comes with the Win32 extensions, but I
> > would recommend Marc-Andre Lemburg's mxODBC, which you will find at
> >
> >     http://www.egenix.com/files/python/
> >
> > Note that a license is required for commercial use. This allows you to
say
> > stuff like:
> >
> >     import mx.ODBC as odbc
> >     conn = odbc.connect("SystemDSNName")
> >     curs = conn.cursor()
> >     curs.execute("SELECT * FROM tablename")
> >     data = curs.fetchall()
>
> Unless I am confused, it appears that the win32
> extensions (as included with ActivePython) allow
> this as well (exactly the same code, except for the
> package name). Is there any particular reason you
> recommend wxODBC over the win32 odbc module?
>

The odbc module has proved to be less than reliable in some situations. If
it works for you, fine! Don't forget to import dbi before importing odbc.

regards
 Steve
--

Steve Holden: http://www.holdenweb.com/ ; Python Web Programming:
http://pydish.holdenweb.com/pwp/








More information about the Python-list mailing list