win32com question

Alex Martelli aleaxit at yahoo.com
Fri May 25 15:54:26 CEST 2001


"Uwe Schmitt" <schmitt at num.uni-sb.de> wrote in message
news:9el8gl$6d2l5$1 at hades.rz.uni-sb.de...
> hi, i wanted to use win32com.client to accessa a database via ado.
> accordint to the reference of win32com.client i tried
>
> conn.Execute("select * from table;",
win32com.client.constants.adOpenDynamic)
>
> and i got a errormessage that the attribute adOpenDynamic is not
> known.
> can anybody help me ?

Hmmm, funny.  Try the following...:

D:\Python21>python
Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> from win32com.client.gencache import EnsureDispatch as disp
>>> x=disp('ADODB.Record')
>>> import win32com.client as w
>>> w.constants.adOpenDynamic
2
>>>

Does this work for you?  If not, you seem to have some serious
installation problem and might want to uninstall your Python
and install a known-good one (mine is standard 2.1 plus the
win32all from ActiveState).  But first try removing the gen_py
directory and running this again -- it might be corrupted,
or something.

If this snippet works, then there must be some problems in
your code before this point...


Alex






More information about the Python-list mailing list