PythonWin ODBC: DSN-less connecting string

Steve Holden sholden at holdenweb.com
Sat Jul 27 00:48:01 EDT 2002


"Jimmy Retzlaff" <jimmy at retzlaff.com> wrote in message
news:mailman.1027727437.25355.python-list at python.org...
> Gabe Newcomb [mailto:Gabe.Newcomb at noetix.com] wrote:

> > I'm unable to find the right combination of options to build a
DSN-less
> > connection string with which I can connect to a database using the
odbc
> > module. Has anybody out there found the right way to do this?

> The current odbc module in win32all doesn't support DSN-less
> connections. A while back I submitted a patch to Mark Hammond to add
> support for this - hopefully it'll make it into the next release of
> win32all.

> In the meantime I'd be happy to send a copy of my patched odbc.pyd
> compiled for Python 2.2/2.2.1, or I can also send odbc.cpp if you'd like
> to compile it yourself for another version of Python.

Note, however, that the ODBC documentation inludes teh following gem:

"""
DriverConnect(DSN_string, clear_auto_commit=1, errorhandler=None)
This constructor returns a connection object for the given datasource which
is managed by an ODBC Driver Manager (e.g. the Windows ODBC Manager or
iODBC). It allows passing more information to the database than the standard
Connect() constructor. """

You might want to consider mxODBC if the licensing doesn't put you off.

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









More information about the Python-list mailing list