|
-
Nov 3rd, 2002, 10:07 AM
#1
Thread Starter
New Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|