[egenix-users] 'Invalid cursor state' when using placeholders?

Fabricio Chalub CHALUB at fgv.br
Mon Jan 12 11:33:14 CET 2004


Hello,

Does anyone observe this behavior on mxODBC?

I get a 

mxODBC.InternalError: ('24000', 0, '[FreeTDS][SQL Server]Invalid cursor state', 2363)

when running the simple example below.  The values are
actually inserted on the database, but mxODBC dies with
that error.  I'm using FreeTDS 0.62rc3 (current), iODBC
(3.51.1), unixODBC (2.2.7) and mxODBC (2.0.6) connecting
to SQL Server 2000.  

If I do the placeholder substitution directly, ie, do 
something like 

INSERT INTO some_table (c1,c2,c3,c4,c5,c6) VALUES ('C',1,'a','b','c','d')

it works nicely.  Any ideas to make this work with
the placeholders cleanly?

---

import mx.ODBC.iODBC
cto = mx.ODBC.iODBC.DriverConnect ("DSN=sqlserver;UID=YYY;PWD=XXX")
areaI = "INSERT INTO some_table (c1,c2,c3,c4,c5,c6) VALUES (?,?,?,?,?,?)"
c2 = cto.cursor()
c2.execute(areaI, ('C', 1, 'T1', 'T2', 'T3', 'T4'))

Thanks,
Fabricio



More information about the egenix-users mailing list