[IronPython] What is .AppendChunk expecting?

Vernon Cole vernondcole at gmail.com
Thu Aug 28 03:28:36 CEST 2008


Dear miracle workers:
  This may actually be the last failed unittest for adodbapai. Progress has
been remarkable.
Can you help with one more?

Situation: filling in the parameter list for an ADO execute.  The second
parameter (parameter 1) is a python "buffer" to be loaded into a binary(4)
column.
"elem" contains the value of the parameter.
"p" is the parameter object.
Pywin32 uses p.AppendChunk successfully to pass the buffer to SQL, but Iron
objects:

<console output>
DatabaseError:
--ADODBAPI
-- Trying parameter 1 = <read-only buffer for 0x000000000000003A, size 4,
offset
 0 at 0x000000000000003B>
Traceback (most recent call last):
   File "C:\Program Files\IronPython 2.0
Beta4\lib\site-packages\adodbapi\adodba
pi.py", line 659, in _executeHelper
    p.AppendChunk(elem)
 TypeError: Specified cast is not valid.
-- on command: "INSERT INTO tblTemp (fldId,fldData) VALUES (?,?)"
-- with parameters: (2, <read-only buffer for 0x000000000000003A, size 4,
offset
 0 at 0x000000000000003B>)
</console output>

What coercion should be supplied to make AppendChunk happy to accept the
buffer contents without trying to cast it?
--
Vernon Cole
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080827/794887fd/attachment.html>


More information about the Ironpython-users mailing list