Menu

#6 Need to use client-side cursors with SQL Server

closed
None
5
2007-07-12
2005-07-12
No

If you execute a query, do not retrieve all the
results, and attempt to execute another query, you'll
get an error related to being in manual transaction
mode. The solution is either to disable the manual
transaction (which breaks DBAPI spec by keeping
autocommit on), or to switch to client side cursors.
You can do this by adding:

self.cmd.Properties["Server Cursor"] =
pyTypeToADOType(False)

to adodbapi.py after line 488.

Discussion

  • Kent Johnson

    Kent Johnson - 2006-09-10

    Logged In: YES
    user_id=49695

    The correct syntax is
    self.cmd.Properties("Server Cursor") = pyTypeToADOType(False)

    (parentheses instead of square brackets)

    Note: this patch is needed to make Table autoload work with
    adodbapi in SQLAlchemy.

     
  • Kent Johnson

    Kent Johnson - 2006-09-10

    Logged In: YES
    user_id=49695

    Never mind...neither syntax works correctly for me.

     
  • Vernon Cole

    Vernon Cole - 2007-06-26

    Logged In: YES
    user_id=855661
    Originator: NO

    now supported in adodbapi 2.1 by setting
    adodbapi.adodbapi.defaultCursorLocation = adodbapi.adodbapi.adUseClient

     
  • Vernon Cole

    Vernon Cole - 2007-07-12

    Logged In: YES
    user_id=855661
    Originator: NO

    This bugfix / patch / enhancement request has been addressed in a subsequent release.

     
  • Vernon Cole

    Vernon Cole - 2007-07-12
    • assigned_to: nobody --> kf7xm
     
  • Vernon Cole

    Vernon Cole - 2007-07-12
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB