I'm using this connection string but something is wrong.
conn = pyodbc.connect
(DRIVER={SQL Server};SERVER=localhost;DATABASE=test;UID=YYY;PWD=XXXX)
connection.close()
How can I do this?
If you're on Linux or macOS then you'll need to install the MS ODBC Driver, available on their website https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017
Then use the Driver String {ODBC Driver 17 for SQL Server}
connection_string = "DRIVER={ODBC Driver 17 for SQL Server};Server=..."