ADO in MS-IIS with MS-SQL Server

Tino Wildenhain tino at wildenhain.de
Thu Oct 14 06:33:53 EDT 1999


Hello Edward,

Edward Wilson wrote:
> 
> Can anyone help me get some basic ADO connections going with Python.  I'm
> running Python inside of MS-IIS with not problems.  What I can't seem to be
> able to get working is an ADO connection to my SQL database.
> 
> I have no idea how to get started, what to import, what to run makepy.py
> against (I've already run it against everything in sight on NT server).
> 
> Please help, if I get over this small hill I'll be on my way to heaven
> "using Python at work on a daily basis".

First of all you dont need ADO for database-access with python from
inside IIS.
You can use it, if you want in the same manner VB uses it. As like as
you 
have the Request and Response objects ready for use so it is with the
ADO.
I personally prefer (if I really have to deal with the IIS-beast)
the use of the odbc-module (it comes with the Win32-extension)

import odbc, dbi
connection=odbc.odbc("Datasource/user/pwd")
cursor=connection.cursor()
cursor.execute(query)

any of:
cursor.fetchone()
cursor.fetchmany(maxcount)
cursor.fetchall()

and so on. The documentation and examples are useable :)
HTH

Tino Wildenhain




More information about the Python-list mailing list