-2
我正嘗試使用Windows身份驗證連接到SQL服務器。我正在通過Visual Studio上的節點js執行此操作。SQL服務器上的Windows身份驗證
SQL服務器在我的機器上。 它已經工作得很好連接字符串
var config = {
server: '10.2.9.208',
database: 'DFMProAnalyticsCopy',
user: 'sa',
password: 'admin123#',
port: 1433 //default port number
};
但是,這僅是爲SQL身份驗證。
現在的Windows aunthentication,我有這樣的連接字符串
var config =
"Driver ={SQL Server};Server = 10.2.9.208;Database=DFMProAnalyticsCopy;Trusted_Connection=True;";
這給了我錯誤
Unknown driver SQL Server!
與此連接字符串
var config =
"Server = 10.2.9.208;Database=DFMProAnalyticsCopy;Trusted_Connection=True;";
給出錯誤
Login failed for user ''
當我想要Windows身份驗證時,它試圖嘗試SQL身份驗證。我打開混合模式身份驗證。
我在很多地方看過,但我對此還是不太清楚。
"Login failed for user ''" when trying to use Windows Authentication
請幫助我。
編輯1:
我不能使用配置字符串作爲SQL Server connection with jQuery and node js 因爲我的是集中式的,任何人都可以使用它,所以我需要使用Trusted_connection = true或集成安全性= SSPI。我沒有使用該系統的人的Windows登錄憑證。
因此,第一個問題是您的應用程序池輔助服務帳戶是否有權訪問SQL實例?它甚至是一個域名服務帳戶還是一個本地帳戶? –
嗨,我檢查了它。我有權訪問SQL實例並且是域服務器帳戶。我編輯了這個問題 –