我在OLEDB方面的知識最少。 有沒有辦法建立一個連接字符串來使用可信的Windows身份驗證,而不是使用用戶ID和密碼?可以將OLEDB連接字符串配置爲使用Windows身份驗證嗎?
1
A
回答
2
是的。 下面是SQL Server 2008的
Provider=SQLNCLI10;Server=myServerAddress;Database=myDataBase; Trusted_Connection=yes;
一個例子,如果你的數據庫是其他東西比SQL Server 2008中(和內發生的可能性非常好的,它不是),你可以得到幾乎任何與此連接字符串例子現場:http://www.connectionstrings.com/
1
既然你沒有說明你會使用什麼語言OLEDB呼叫通過我只是發佈了一些基本的C#這樣的伎倆。
using System.Data.OleDb;
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString =
「Driver = SQLOLEDB;」 +
「Data Source = ServerName;」 +
「Initial Catalog = DataBaseName;」 +
「Integrated Security = SSPI;」;
conn.Open();
0
正如How To: Connect to SQL Server Using Windows Authentication in ASP.NET 2.0文章MSDN狀態,
使用Windows驗證必須加入Trusted_Connection =是屬性,或等效的屬性集成安全性= SSPI,如下所示的連接字符串。
所以不是User Id=...;
和Password=...;
你應該包括你的連接字符串在下面的選項之一,
- Trusted_Connection =是
- 集成安全性= SSPI
相關問題
- 1. 使用Windows身份驗證的Oracle連接字符串
- 2. 加密Windows身份驗證連接字符串
- 3. sql連接字符串Windows身份驗證c#winforms(未集成)
- 4. 沒有Windows身份驗證模式的C#連接字符串
- 5. 可以使用Windows身份驗證與IIS上的PHP進行ODBC連接嗎?
- 6. 無法使用Windows身份驗證連接SSMS,但可以使用SQL身份驗證登錄
- 7. MSSQL連接字符串 - 使用另一組憑據進行Windows身份驗證
- 8. 我可以使用Facebook連接作爲我的用戶身份驗證嗎?
- 9. 用於AspNetDb的Sql身份驗證連接字符串
- 10. Windows身份驗證到使用配置文件的自定義身份驗證
- 11. 我可以使用Windows身份驗證與ASP.Net身份?
- 12. 如何使用Windows身份驗證將System.Data.OracleClient連接到oracle db?
- 13. 如何配置Tomcat以使用Windows NTLM身份驗證?
- 14. 配置Tomcat以使用Windows Active Directory進行身份驗證
- 15. 如何配置PostgreSQL以使用Windows身份驗證?
- 16. 可以在沒有Apache的情況下將Subversion配置爲Windows身份驗證
- 17. Windows身份驗證配置問題
- 18. 身份驗證:如何配置git bash以使用SAML身份驗證?
- 19. 將MicroStrategy連接到身份驗證的Apache配置單元
- 20. SQL Server 2005 SQL身份驗證連接字符串
- 21. Plink身份驗證串行連接
- 22. 使用Python使用Windows身份驗證連接到MS SQL Server?
- 23. 使用Windows身份驗證連接到本地SQL Server數據庫的連接字符串
- 24. 連接字符串不能使用默認的用戶身份驗證
- 25. 使用Windows身份驗證的簡單身份驗證代理
- 26. Visual Studio配置Azure AD身份驗證表示Windows身份驗證配置爲不是
- 27. SQL服務器 - 連接使用Windows身份驗證
- 28. 使用Windows身份驗證的SQL Server連接wso2 dss
- 29. SQL Server Management Studio無法使用Windows身份驗證連接
爲什麼有些地方將它顯示爲「Trusted_Connection = TRUE」,其他顯示爲「Trusted_Connection = YES」? SSIS似乎需要「YES」版本。 – PeterX 2013-07-29 04:39:06