currently I am accessing my MS SQL database from Python using SQLalchemy with the Native SQL Client. According to this page it is deprecated you should use the Microsoft OLE DB Driver for SQL Server instead. My problem now is that I cannot figure out how to change the connection string. My old working string for the Native client was:
engine = sqlalchemy.create_engine(f'mssql+pyodbc://{databaseAccess}@{Hostname:Port}/{database}?driver=SQL+Server+Native+Client+11.0', echo=True)
For the new string my best guess is the following but of course it does not work. I assume the driver variable must be different and maybe the pyodbc must also be replaced.
sqlalchemy.create_engine(f'mssql+pyodbc://{databaseAccess}@{Hostname:Port}/{database}?driver=Microsoft+OLE+DB+Driver+19+for+SQL+Server', echo=True)
Just to make this post complete: The error I get is the following sadly it is in German but it basically says: that the data source could not be found as the driver is no default driver. I strongly assume that this just means my string is wrong.
(pyodbc.InterfaceError) ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Der Datenquellenname wurde nicht gefunden, und es wurde kein Standardtreiber angegeben (0) (SQLDriverConnect)')
(Background on this error at: https://sqlalche.me/e/14/rvf5)