Connection Problem - ado failover connection 
Author Message
 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



Sun, 27 Jan 2002 03:00:00 GMT  
 Connection Problem - ado failover connection

Quote:
> 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

Do you have an
    On Error Resume Next
statement above all of this?

- Thomas Kiefer



Sun, 27 Jan 2002 03:00:00 GMT  
 Connection Problem - ado failover connection
Sometimes the answer is obscured because it's right in front of your nose...

We had used the On Error Resume Next, but put it after the first Conn.Open -
moving it to the top of the section did the trick!

Thanks for the help,

Wendell Hubbell


Quote:


> > 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

> Do you have an
>     On Error Resume Next
> statement above all of this?

> - Thomas Kiefer




Mon, 28 Jan 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ADO Connection State Does Not Reflect Actual Connection State

2. Connection Errors via ADO Connection Object

3. ADO Connection - How to set ANSI_NULLS OFF through the connection

4. Release ADO connection from a connection pool

5. ADO connection passed to a DLL fails to maintain valid connection

6. ADO Connection Speed Connection

7. VB6: Problem sharing ADO connection between COM Objects (complex problem)

8. Problem sharing ADO connection between COM Objects (complex problem)

9. VB6: Problem sharing ADO connection between COM Objects (complex problem)

10. Problem sharing ADO connection between COM Objects (complex problem)

11. ADO Connection Problem and Windows 2000 - multiuser problem

12. ADO Connection Problem

 

 
Powered by phpBB® Forum Software