[IronPython] Return value for ADODB .Execute() call?

Curt Hagenlocher curt at hagenlocher.org
Wed Aug 27 22:10:09 CEST 2008


On Wed, Aug 27, 2008 at 12:17 PM, Vernon Cole <vernondcole at gmail.com> wrote:
>
> We can't pass the "ra" parameter in python, so pywin32 returns a tuple with
> the recordset and the number of records.
>
> How do I retrieve the number of records (for a non-row-returning query) in
> Iron?

Presumably, Execute expects you to pass a VT_I4 | VT_BYREF so that it
can store the value in the reference.  If this were for a CLR API,
you'd pass an int reference by using a variable of type
clr.Reference[int](). I don't know that this will work for COM, but I
assume that it would:

ra = clr.Reference[int]()
self.cmd.Execute(ra)
recordCount = ra.Value

--
Curt Hagenlocher
curt at hagenlocher.org



More information about the Ironpython-users mailing list