pyodbc can't connect to database

前端 未结 2 1088
南旧
南旧 2020-12-18 10:11

I\'m using pyodbc library from here and I\'m connecting this way:

conn = pyodbc.connect(r\'DRIVER={SQL Server Native Client 11.0};Server=(locald         


        
2条回答
  •  我在风中等你
    2020-12-18 10:55

    It could possibly be a security issue. You are using integrated security so it will use the security credentials of the windows login that the client program is running. If that user or a group that the user belongs to does not have at least public access to the database, it will appear as if the database does not exist. Either ensure that the user or a group that the user is a member of is set up with a login and that it has at least public access to your database, or use SQL server authentication and send a username and password in your connection string.

提交回复
热议问题