How to properly connect to sql server in python us

2019-05-19 15:57发布

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?

0条回答
登录 后发表回答