mxODBC windows and cursors

Gordon McMillan gmcm at hypernet.com
Fri Oct 15 23:22:49 EDT 1999


damien_morton at my-deja.com wrote:
>  I have been using the mxODBC library in a win32 environment, and
> Ive struck a small problem. Perhaps someone can help. 
[snip]
> The result of executing this code is listed below:
> >>> OperationalError: ('S1000', 0, '[Microsoft][ODBC SQL Server
> >>> Driver]
> Connection is busy with results for another hstmt', 3205)
> 
> 
> This seems to indicate to me that I can have only one active
> cursor per connection. Is this necessarily true? 

Nope. As the error msg shows, this a limitation of the driver, 
not ODBC, nor the DB.

> Is there some
> way around this limitation, or will I need to maintain a
> connection for each cursor? (my tests indicate that each
> connection is about 600K, whereas each cursor is about 3K)

You'd probably do better to fetch everything you need from one 
statement before executing the next. If your processing really 
involves both resultsets, the DB would be even happier if you 
worked out how to do what you want using set processing 
instead of record-at-a-time processing.

- Gordon




More information about the Python-list mailing list