我们配置了一个用于镜像的SQL Server。今天的初始服务器失败了,除了VB.NET应用程序外,几乎所有应用程序都正确地进行了故障转移。
当它开始设置连接字符串时,我收到以下错误:
"Keyword not supported: 'failover partner:sql-failover;initial catalog'."
以下是连接的代码:
Dim sConnectionString As String
Dim sServer As String
Try
'Always connect to production server to get startup environment variables
If gbIsProduction Then
If gsProductionServer = "" Then
sServer = "PROD-SQL"
Else : sServer = gsProductionServer
End If
Else : sServer = gsDevelopmentServer
End If
sConnectionString = "Data Source=" & sServer & ";Failover Partner:SQL-FAILOVER;Initial Catalog=*****;User ID=****;Password=******;"
cnSystem.ConnectionString = sConnectionString
cnSystem.Open()
cmdSystem.Connection = cnSystem
Catch ex As Exception
RaiseError("", "modGeneral." & System.Reflection.MethodBase.GetCurrentMethod().Name, Err.Number, Err.Description)
有什么理由?我知道.NET 1.1不支持Failover Partner,但我使用的是框架3.5 SP1。
谢谢!
答案 0 :(得分:3)
这部分连接字符串错误
....;Failover Partner:SQL-FAILOVER;.....
应该是
....;Failover Partner=SQL-FAILOVER;......