Mirrored SQL connection string

Hi Experts

i have an asp application running under ASP/SQL
my connection string i asp file is
Connection.Open "DRIVER={SQL Server}; Server=" & varServerIP & "; Database=" & varDataBaseName & "; UID=" & varUserName & "; PWD=" & varPassword'

I am migration now my db to a mirrored plateforme with three sql servers
sMaster, slave and mirror

how to modify my connection string
i have seen on ee formums a connection string like this
Data Source=myServerAddress;Failover Partner=myMirrorServer;Initial
Catalog=myDataBase;Integrated Security=True;

But i dont know how to adapt my connection string to the new one
please advise
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
please read this article:

it contains also sample code.
note that the only part you have to add to your connection string is the Failover Partner.
humer2000Author Commented:
i already read it this morning and it did not give me any examples
i am a beginner in this :)
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I repeat:
the only part you have to add to your connection string is the Failover Partner stuff.
in the article they mention that depending on what technology you use, it might be with space or underscore ...
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

humer2000Author Commented:
i have added the code and i am getting error
Microsoft OLE DB Service Components error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
/shop$dbconnect.asp, line 166

My connection is the following

Connection.Open "Driver={SQL Native Client}; "          &_
      "Server="       & varServerIP  & ";"      &_
      "Database=" & varDataBaseName              & ";"      &_
      "Uid="             & varUserName      & ";"      &_
      "Pwd="             & varPassword       & ";"      &_
      "Data Source="       & varServerIP       & ";"      &_
      "Failover Partner=xx.xx.xx.xxx;"                                                &_
      "Initial Catalog=" & varDataBaseName                            & ";"      &_
      "Integrated Security=True;"
Guy Hengel [angelIII / a3]Billing EngineerCommented:
unfortunately, I have no means to set up the same environment to test :(

however, with Sql Native Client:

Connection.Open "Driver={SQL Native Client}; "          &_
      "Server="       & varServerIP  & ";"      &_
      "Database=" & varDataBaseName              & ";"      &_
      "Uid="             & varUserName      & ";"      &_
      "Pwd="             & varPassword       & ";"      &_
      "Data Source="       & varServerIP       & ";"      &_
      "FailoverPartner=xx.xx.xx.xxx;"                                                &_
      "Initial Catalog=" & varDataBaseName                            & ";"      &_
      "Integrated Security=True;"

Open in new window

humer2000Author Commented:
lol, it's the same code as mine !  anyway i copy/pasted the code
same error :(

Guy Hengel [angelIII / a3]Billing EngineerCommented:
it's not the "same" code... there is no space in the Failover Partner :)
anyhow, if it does not work, that does not really matter ...

sorry, but I don't know more about this.
please use the "request attention" link, so a moderator can try to attract more experts to the question.
humer2000Author Commented:
where is the  "request attention" link ??? i dont see it !

i just want to make a note, maybe this will help u,

SQL db is hosted on SQL 2005 Enterprise
ASP application is hosted on another server running Win 2003 Enterprise
humer2000Author Commented:
the correct syntax is the following

Connection.open "Driver={SQL Native Client};Server=" & varServerIP & "; Failover_Partner=; Database=" & varDataBaseName & "; Uid=" & varUserName & "; Pwd=" & varPassword

You should not put Integrated Security=True
If you add this , it won't work

However what's the purpose of Integrated Security=True ?
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>However what's the purpose of Integrated Security=True ?

that will tell the driver to use the currently connected windows account for login to sql server.
however, in web-driven pages this means that unless you are in a intranet site with anonymeous user disabled, it will not be able to use the front-end user windows account, but it uses the asp/iis service startup account.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.