--- mssql_orig.vbs 2022-11-29 16:18:41.885345100 +0100 +++ mssql_fixed.vbs 2022-12-02 14:12:05.460862000 +0100 @@ -609,10 +609,19 @@ For Each connProv in Array("msoledbsql", "sqloledb", "sqlncli11") CONN.Provider = connProv + + DIM useSSPI + useSSPI = False + if not AUTH.Exists("type") then + useSSPI = True + elseif AUTH.Item("type") = "system" then + useSSPI = True + end if + ' At this place one could implement other authentication mechanism ' Note that these properties have to be set after setting CONN.Provider - If Not AUTH.Exists("type") or AUTH("type") = "system" Then + If useSSPI Then CONN.Properties("Integrated Security").Value = "SSPI" Else CONN.Properties("User ID").Value = AUTH("username")