
Connection Problem - ado failover connection
Hello,
We are trying to set our pages up so that if the first connection to our
primary SQL server (database 1) fails, the page will attempt to connect to
our secondary SQL server (database 2 - replicated content). No such luck -
here is what we tried (it dies at the first Conn.Open if we disable database
1) :
database1 = "DSN=x; UID=x; PWD=x"
database2 = "DSN=xx; UID=xx; PWD=xx"
connectstring = database1
Dim Conn
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = connectstring
Conn.Open
If Conn.State = adStateClosed Then
connectstring = database2
Conn.ConnectionString = connectstring
Conn.Open
End If
Any suggestions?
Thanks in advance
Wendell Hubbell