OLEDB SQL Provider: Failover Partner Connection String

We are trying to connect to SQL with database mirroring enabled. We have 2 servers: DB1 (Principal) and DB2 (Mirror).

We use the connection string:

Provider=SQLOLEDB;Data Source=DB1;Failover Partner=DB2;Database=databasename;Uid=username;Pwd=password;

      

When DB1 is in the lead, everything works fine. But when DB1 goes down and DB2 (Mirror) becomes primary, we get an error:

Invalid connection string attribute

We tried to change datasource from server name to IP, to IP: 1433 ... with no success. We also tried to change the Failover Partner parameter to FailoverPartner, also without success.

Can I even connect to a database mirror with the SQLOLEDB provider?

+3


source to share


1 answer


You need to use SQL Native Client or ado.net and not sqloledb as it does not support the failover partner option.



+1


source







All Articles