[IronPython] [ANN]: IronPython 2.6 Beta 2

Dino Viehland dinov at microsoft.com
Tue Aug 4 01:33:56 CEST 2009


Ok, I've finally got SQL server setup in a reasonable state where I can try and repro this.  This is what I'm trying to do.  I have a database called "mydatabase" which contains a table "Table_1" which contains 1 column of type binary(4).  I then attempt to do:

import System
conn = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection"))
connstr = "driver={SQL Server};Server=localhost;Database=mydatabase;Initial Catalog=mydatabase;Trusted_Connection=True;"
conn.ConnectionString = connstr
conn.Open()

rs = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.RecordSet"))
rs.Open("Table_2", conn, 1, 2, 2)  # source, active connection, cursor type (adOpenKeyset), lock type (adLockPessimistic), CommmandType (adCmdTable)
rs.AddNew()
b = System.Array[System.Byte]((2,3,4,5))
x = rs['Test1']
x.AppendChunk(b)

which fails with:

EnvironmentError: System.Runtime.InteropServices.COMException (0x800A0C93): Operation is not allowed in this context.

This is the same failure I get if I use Shri's proposed work around.  Do you have any idea of what I'm doing wrong or any suggestions on how to tweak this to get the correct simple repro?

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole
Sent: Thursday, July 23, 2009 10:11 PM
To: Discussion of IronPython
Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2

Guys:
  Good work on the new release, and the 215 bug fixes. As usual, as soon as the new beta was announced I downloaded and tested it.

Somehow I got the idea that the adodbapi test had been included in the IronPython test suite. Did you only include the tests that already pass?  Issue 18222 is still unfixed -- so adodbapi still fails, and you still cannot pass a read-only buffer as a COM parameter.

I realize that no one has voted up this rather obscure bug. Perhaps if it were titled "fully support DB API 2.0 compliant database access using ADO" it would have gotten more votes. Nevertheless, this issue has been outstanding for 11 months, and is the only remaining failure in adodbapi for versions 2.3 thru 3.1 of python. Please try to get to it before 2.6 final.

Please !!!???
--
Vernon Cole

P.S. -- I plan to make a version of adodbapi which uses real ADO.NET<http://ADO.NET>, rather than ADO via COM, but I want the current version to be solid before I start mucking it up.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090803/699c0a97/attachment.html>


More information about the Ironpython-users mailing list