How can I specify the type of cursor for a recordset in pyobbc?

I struggle with Python scripts that use ADODB classes through COM. I came to the conclusion that the pyobbc module would be better for my purposes. However, there are options available in the ADODB.Recordset.Open () method, which I do not see in pyobbc.

ADODB.Recordset.Open () takes five arguments: a query string, database connections, cursor type, lock type, and a bitmask for text and options. Usually we specify a dynamic cursor (cursor type 2), optimistic lock (lock type 3) and a query string without special execution options (option value 1). There is another option that is not controlled in the Open () method: cursor location. Before calling the Open () function, the CursorLocation property of the recordset can be set to adUseServer (unknown value) or adUseClient (3, if I remember correctly).

While I don't know a single instance in any code that my company has ever written where it might matter, it would still be nice to make this choice through pyodbc. Where will these elections be made?

+5
source share

Source: https://habr.com/ru/post/1241641/


All Articles