ADO Connection Error handling
I'm attempting to connect to various SQL DB's on different Servers
by using the IP of each server.
The problem is that if the IP has changed and I attempt to connect I get the old -2147467259 error when the app is attempting to Open the connection.
Is there a way to trap this error so that if the Open doesn't occur
I can handle it?
Also can I incorporate the "ping.exe" into my code to update the
DB ServerIP field???
Dim cSQLConn As Connection
Set cSQLConn = New Connection
cSQLConn = "Provider=SQLOLEDB" & _
";Data Source=" & rsServer.Fields("ServerIP").Value & _
";User ID=" & rsServer.Fields("ServerDBLogin").Value & _
";Password=" & rsServer.Fields("ServerDBPassword").Value & _
";Initial Catalog=" & rsServer.Fields("DatabaseName").Value
cSQLConn.CommandTimeout = 400
cSQLConn.Open
Thanks
Bill