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?
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.
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 :)
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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 ...
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 ?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.