ADO constants
Mark Hammond
mhammond at skippinet.com.au
Fri Dec 6 01:47:55 EST 2002
Paul Denize wrote:
> I'm having trouble getting the constants in the ADO calls working.
>
> From examples I have found they appear to be comming from
> win32com.client.constants
>
> but when I try I get
>
> C:\>python
> Python 2.2.1 (#34, Apr 9 2002, 19:34:33) [MSC 32 bit (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
>
>>>>import win32com.client
>>>>a=win32com.client.constants.adInteger
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "C:\Python22\lib\site-packages\win32com\client\__init__.py",
> line 131, in __getattr__
> raise AttributeError, a
> AttributeError: adInteger
>
>
>
> Can anyone tell me what I'm doing wrong ?
>
> I have my programs working but had to substitute the constants with
> the
> enumerated values for things like Locking, ClientSide, RecordsetOpen
> ... etc
> All the examples I see have constants drawn from somewhere but I just
> cant find them.
These constants are only available when you have run makepy for the library.
Execute "makepy.py -i", and select the ADO library. Paste the resulting
code at the top of your source file - the constants will then become
available.
Mark.
More information about the Python-list
mailing list