ADO and Makepy

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alv Mart

    ADO and Makepy

    Hi,

    I ran makepy for ADO. After I installed a new version of python I have this
    error:

    Do you know why could I have this error?
    [color=blue][color=green][color=darkred]
    >>> from ADODB import Connection,Reco rdset[/color][/color][/color]
    [color=blue][color=green][color=darkred]
    >>> conn = Connection()[/color][/color][/color]


    Traceback (most recent call last):

    File "<interacti ve input>", line 1, in ?

    File "C:\Python2\lib \site-packages\win32c om\client\__ini t__.py", line 479,
    in __init__

    if oobj is None: oobj = pythoncom.new(s elf.CLSID)

    TypeError: Only strings and iids can be converted to a CLSID.

    I have run makepy again but it does not work

    egards



  • Mark Hammond

    #2
    Re: ADO and Makepy

    Alv Mart wrote:[color=blue]
    > Hi,
    >
    > I ran makepy for ADO. After I installed a new version of python I have this
    > error:
    >
    > Do you know why could I have this error?
    >[color=green][color=darkred]
    > >>> from ADODB import Connection,Reco rdset[/color][/color]
    >
    >[color=green][color=darkred]
    >>>>conn = Connection()[/color][/color][/color]

    You shouldn't need to import the makepy generated module manually. You
    should just be able to use win32com.client .Dispatch("ADO. Connection").

    This will magically use a Connection class from the makepy module. You
    can also avoid manually running makepy, by calling gencache.Ensure Module
    - run "makepy.py -i" for details.

    Mark.

    Comment

    Working...