You can try to establish a connection to the server, and then if an error is thrown, do something, else... Like:
On Error Resume Next
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
Err.Clear
cn.Open "Provider=SQLOLEDB;Data Source=ServerName;Initial Catalog=DatabaseName;UID=UserID;PWD=Password"
If Err <> 0 Then 'error was encountered trying to connect to database
MsgBox "something"
Exit Sub
Else
Me.SynchButton.Enabled = True
End If
cn.Close 'in case there was not an error. If it wasn't opened, this would throw an error, except for on error resume next, I think.
Did that help?
mmcdonal
Look it up at:
http://wrox.books24x7.com