jiangwen365 / pypyodbc

A pure Python Cross Platform ODBC interface module
MIT License
179 stars 74 forks source link

Connect to azure Sql #93

Open ronmorg opened 5 years ago

ronmorg commented 5 years ago

i seem to not be able to connect to azure in the cloud using pypyodbc

pypyodbc.ProgrammingError: (u'42000', u"[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Reference to database and/or server name in 'master..sysdatabases' is not supported in this version of SQL Server.")

mycode goes something like this:

cnxn = pyodbc.connect('DRIVER='+driver+';SERVER='+server+';PORT=1433;DATABASE='+database+';UID='+username+';PWD='+ password)

braian87b commented 5 years ago

That is an ODBC error, try to fix your odbc connection first... or put the evaluated connection string here... also google "Azure ODBC SQL Server Driver" to get more help on this topic. Azure have some tricks to make it work.