Traceback (most recent call last):
File "C:/Users/Gord/PycharmProjects/py3pyodbc_demo/main.py", line 96, in <module>
cnxn.set_attr(pyodbc.SQL_ATTR_CURRENT_CATALOG, "master")
TypeError: an integer is required (got type str)
If set_attr could be modified to also accept a string value then we'd have a database-independent way of changing the current catalog.
The Python DB API makes no mention of changing the current catalog. However,
System.Data.Odbc
in .NET has aConnection#ChangeDatabase
method andresults in
so in Python I tried
but I got
If
set_attr
could be modified to also accept a string value then we'd have a database-independent way of changing the current catalog.