How to properly connect to sql server in python using pypyodb

假如想象 提交于 2019-12-22 16:36:10

问题


When I type in the code:

connection = pypyodbc.connect(driver='{SQL Server}', server=ServerName, database=DatabaseName, uid=UserId, pwd=Password)

I get this error:

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.")

Does anyone know how to fix it?

来源:https://stackoverflow.com/questions/45201916/how-to-properly-connect-to-sql-server-in-python-using-pypyodb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!