[python-win32] Newbie question - how do I use the constantsgenerated by makepy?

Jens B. Jorgensen jens.jorgensen at tallan.com
Fri Aug 27 18:32:39 CEST 2004


Constants are a bit of a problm in COM because in point of fact they 
have nothing to do with the COM interface per se. COM constants are 
actually laid out in type libraries. If you're run makepy.py and 
selected the correct type library then when you create an instance of 
that object then the constant you are after is in:

win32com.client.constants.adUseClient

R. Alan Monroe wrote:

>I'm trying to use ADODB from Python, but it's not clear to me how I'm
>supposed to access the constants for various enums...
>
>Traceback (most recent call last):
>  File "adotest.py", line 10, in ?
>    conn.CursorLocation = adUseClient
>NameError: name 'adUseClient' is not defined
>
>Am I supposed to manually import the
>EF53050B-882E-4776-B643-EDA472E8E3F2x0x2x7.py file that makepy
>generated at the top of my own program, or is it supposed to get
>automagically imported when I call win32com.client.Dispatch? If it's
>automatic, how do I get at the constants?
>
>Alan
>
>_______________________________________________
>Python-win32 mailing list
>Python-win32 at python.org
>http://mail.python.org/mailman/listinfo/python-win32
>  
>


-- 
Jens B. Jorgensen
jens.jorgensen at tallan.com

"With a focused commitment to our clients and our people, we deliver value through customized technology solutions"  

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2861 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.python.org/pipermail/python-win32/attachments/20040827/704547cb/smime.bin


More information about the Python-win32 mailing list