I am running a query to a remote MSSQL server off of my default page. Most of the time it works great, unless that server is down. In this case, it takes a very long time to load the page. I am trying to use connectiontimeout or commandtimeout to limit the amount of time we waste if the connection cannot be made but I cannot get them to make any difference in the timing. Does anyone have any suggestions? The code is below....
Thanks
-------------------------------------------
Set connection1 = Server.CreateObject("ADODB.Connection")
varServerIP = "999.999.999.999"
varUserName = "myname"
varPassword = "mypass"
varDataBaseName = "mydb"
connection1.ConnectionTimeout= 5
connection1.CommandTimeout= 5
connection1.Open "DRIVER={SQL Server}; Server=" & varServerIP & "; Database=" & varDataBaseName & "; UID=" & varUserName & "; PWD=" & varPassword
-----------------------------------------------
Thanks
-------------------------------------------
Set connection1 = Server.CreateObject("ADODB.Connection")
varServerIP = "999.999.999.999"
varUserName = "myname"
varPassword = "mypass"
varDataBaseName = "mydb"
connection1.ConnectionTimeout= 5
connection1.CommandTimeout= 5
connection1.Open "DRIVER={SQL Server}; Server=" & varServerIP & "; Database=" & varDataBaseName & "; UID=" & varUserName & "; PWD=" & varPassword
-----------------------------------------------