2012-08-03 79 views
1

我们配置了一个用于镜像的SQL Server。最初的服务器今天失败了,几乎所有的应用程序都失败了,除了VB.NET应用程序。不支持的关键字:VB.NET中的'failover partner:sql-failover;初始目录'

在启动时设置连接字符串,我得到以下错误:

"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中不支持故障转移合作伙伴,但我使用的是框架3.5 SP1。

谢谢!

回答

3

连接字符串的这一部分是错误的

....;Failover Partner:SQL-FAILOVER;..... 

应该

....;Failover Partner=SQL-FAILOVER;...... 
+0

是啊,我刚才看到的,谢谢。现在,连接字符串得到了正确的验证,但它并没有跳到故障转移服务器。它是否必须与初始服务器建立成功连接才能进行故障转移? – Tom 2012-08-03 13:24:47

+0

不知道[this](http://support.microsoft.com/kb/941526)文章是否有帮助。 – Steve 2012-08-03 13:42:14