简体   繁体   English

如何使用Windows身份验证连接字符串使用OLEDB连接到SQL Server

[英]How do I connect to SQL Server using OLEDB using Windows Authentication connection string

I have SQL Server 2010 running in windows auth mode and the proper groups have been assigned. 我有在Windows身份验证模式下运行的SQL Server 2010,并且已分配了适当的组。 I can connect via the SQL Server Client Studio using windows auth. 我可以使用Windows身份验证通过SQL Server Client Studio连接。 That works. 这样可行。 But when connecting using .NET OLEDB connections it fails and I can't figure out why. 但是,当使用.NET OLEDB连接进行连接时,它将失败,我无法弄清原因。

Here is the string: 这是字符串:

data source=172.20.0.113;initial catalog=ForgeEnterprise;Integrated Security=SSPI;multipleactiveresultsets=True;App=EntityFramework

And here is the error: 这是错误:

Login failed for user 'MOMENTUMI\jmcclure'

Is there something I'm missing? 有什么我想念的吗?

According to http://connectionstrings.com/sql-server-2008 this should do the trick 根据http://connectionstrings.com/sql-server-2008,这应该可以解决问题

Provider=SQLNCLI10;Server=172.20.0.113;Database=ForgeEnterprise;Trusted_Connection=yes;

Where Trusted_Connection is the same as Integrated Security apparently. 其中,Trusted_Connection与集成安全性显然相同。

If that doesn't work, you should verify that the user is added in the permissions tab (picture) for the database, but I guess you already did that. 如果这不起作用,则应验证是否已在数据库的“权限”选项卡(图片)中添加了该用户,但我想您已经这样做了。

如图所示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法通过Windows身份验证使用连接字符串连接到SQL Server - Unable to connect to SQL Server using a connection string with Windows authentication 使用Windows身份验证连接到本地SQL Server数据库的连接字符串 - Connection string to connect to a local SQL Server database using windows authentication 如何使用 Windows 身份验证通过 sqlalchemy 连接到 SQL 服务器? - How do I connect to SQL Server via sqlalchemy using Windows Authentication? 尝试使用繁琐的连接和 Windows 身份验证连接到 SQL 服务器? - Trying to connect to SQL server using Tedious Connection and Windows Authentication? 如何在不使用trusted_connection的情况下从Windows连接到SQL Server? - How do I connect to SQL Server from Windows without using trusted_connection? 连接字符串,用于使用其他Windows帐户连接SQL Server - Connection String to connect a SQL Server using another windows account 使用 DBeaver 连接到 SQL Server Windows 身份验证 - Connect to SQL Server Windows Authentication using DBeaver 使用带有Windows身份验证的Powershell连接到SQL Server - Connect to SQL Server using Powershell with Windows Authentication 如何定义从Windows应用程序连接到SQL Server的连接字符串? - How do I define a connection string to connect to SQL Server from a Windows application? 无法使用Windows身份验证连接Sql Server - Unable to Connect Sql server using Windows Authentication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM