MicrosoftDocs / azure-docs-sdk-python

Azure Python SDK documentation, hosted on docs.microsoft.com.

Home Page:https://docs.microsoft.com/python/api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Driver Value Doesn't work

dapolloxp opened this issue · comments

When trying to connect to SQL using the Python driver listed below, the connection fails

https://docs.microsoft.com/en-us/python/api/overview/azure/sql?view=azure-python#connect-to-a-sql-database

I have to use this format for it to connect

cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=localhost;DATABASE=testdb;UID=me;PWD=pass')

@kraigb -- can you investigate?

@dapolloxp From what I can see, you're saying that DRIVER needs to be {SQL Server} rather than {ODBC Driver 13 for SQL Server}. Is that the case? It looks like everything else is the same, except that your format doesn't include PORT; perhaps that also isn't needed?