The connection issue occurred due to how the connection string was interpreted by Python 3.10.0.
CONNECTION_STRING: Final[str] = f"DRIVER={{ODBC Driver 18 for SQL Server}};SERVER=tcp:{server_url},{port};DATABASE={database_name};Encrypt=yes;TrustServerCertificate=yes;"
CONNECTION_STRING: Final[str] = (
f"DRIVER={{ODBC Driver 18 for SQL Server}};"
f"SERVER={host};"
f"DATABASE={database};"
f"Encrypt=yes;"
f"TrustServerCertificate=no;"
f"Connection Timeout={timeout};"
)
⚠️ Note: Do not consider changes in parameter names (like
server_url,port, etc.). The key issue lies in how the connection string is constructed, not the variable names.