2010-10-04 251 views
3

我使用此連接字符串進行服務器身份驗證,連接字符串

Dim rs As New ADODB.Recordset 



strConnectionString = "Provider=SQLOLEDB.1;Persyst Security Info=False;User Id=fileade;Password=fileade;Initial Catalog=Fileade;Data Source=10.237.225.170;Command Properties='Command Time Out=45'" 

這將是在Windows身份驗證連接字符串?

+1

'Persyst安全信息' - 應該是'Persist'而不是'Persyst'嗎? – onedaywhen 2010-10-04 18:25:40

回答

1

設置集成安全性=真

下面是完整的字符串:

Provider=SQLOLEDB.1;Integrated Security=True;Initial Catalog=Fileade;Data Source=10.237.225.170;Persyst Security Info=False;Command Properties='Command Time Out=45'" 
0
strConnectionString = "Provider=SQLOLEDB.1;Persyst Security Info=False;User Id=fileade;Password=fileade;Integrated Security=true;Initial Catalog=Fileade;Data Source=10.237.225.170;Command Properties='Command Time Out=45'" 
0

我通常使用Excel來創建連接字符串我。只需嘗試使用所需的選項連接到服務器,並且數據連接屬性將具有連接字符串。

我認爲你將不得不集成安全性設置爲SSPI

這裏是爲我工作的一個字符串,我修改您的具體情況:

strConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=Fileade;Data Source=10.237.225.170" 

希望有所幫助。