[ANN]pre-release DBAPI2.0 for ADO

Michel Orengo morganea at bellatlantic.net
Thu Jul 6 13:44:20 EDT 2000


DBAPI provides a common interface (so does ODBC or ADO), but you still have
to deal with SQL (to process your commands). Just assigning a cursor will
not do the trick. Moreover a cusor is linked to a perticular connection
(~database)

You may want to look at modules that define layers on top of the DBAPI such
as Dtuple, SQLDict, or db-obj.

Michel



"Olivier Dagenais" <olivierS.dagenaisP at canadaA.comM> wrote in message
news:PxL85.40906$W35.880547 at news20.bellglobal.com...
> Hey, this announcement made me think of a question concerning databases:
is
> the DBAPI designed for exchanging recordsets between databases opened by
two
> different implementations?
>
> For example, could I take your ADO cursor and assign it to a database
opened
> with, say, Gadfly?  (supposing they had the same table definitions)
>
> Thanks!
>
> --
> ----------------------------------------------------------------------
> Olivier A. Dagenais - Carleton University - Computer Science III
>
>
> "Michel Orengo" <morganea at bellatlantic.net> wrote in message
> news:B5L85.2924$EV6.75523 at typhoon1.ba-dsg.net...
> > Hi all,
> > I enclosed a very preliminary version of the DBAPI 2.0 for ADO
(Microsoft
> > Active X Data Object) - ADODBpy. It is built on top of another module
> called
> > ADOpy which give a more "pythonic" interface to ADO (I've posted this
> module
> > few days ago)
> >
> > ADODBpy is still largely incomplete (does not deal with exceptions for
> > instance). It is released to get a feedback from the python community.
> >
> > Some examples to get you started:
> >
> > import ADODBpy
> >
> > db = ADODBpy.connect('MyDB', 'MyUser', 'MyPassword')
> > cur = db.cursor()
> > cur.execute('select * from mytable')
> > tup = cur.fetchone()
> >
> > #now because it is build on top of ADOpy, we can access also the
> > properties/methods of the
> > #underlying ADOobject
> > print db.provider
> > print cur.fields.Item('col').Value
> > # or better:
> > print cur['col']
> >
> > Hope this help.
> > Cheers,
> > Michel
> >
> >
> >
>
>





More information about the Python-list mailing list