I am trying to make & test an ADO connection to SQLServer7. The routine works fine if the details in the connection string are correct, or if either the uid/pwd is wrong.
However if the server does not exist, the connection waits for approx 1 minute before returning the error:
"[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied."
I have changed the timeout settings but the 1 minute delay remains...
Please can somebody advise how can I get this error to occur sooner - within a couple of seconds would be good!
Thanks in advance
#####
Extract from code:
Dim cn As ADODB.Connection
Dim strCN As String
Dim blnSuccess as Boolean
Set cn = New ADODB.Connection
strCN = "driver={SQL Server};DSN=;server=168.128.1.5;database=Pubs;uid=user;pwd=;"
cn.ConnectionTimeout = 10
cn.Open strCN
If cn.State = 1 Then
blnSuccess = True
Else
blnSuccess = False
End If
cn.Close
Set cn = Nothing
#####
However if the server does not exist, the connection waits for approx 1 minute before returning the error:
"[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied."
I have changed the timeout settings but the 1 minute delay remains...
Please can somebody advise how can I get this error to occur sooner - within a couple of seconds would be good!
Thanks in advance
#####
Extract from code:
Dim cn As ADODB.Connection
Dim strCN As String
Dim blnSuccess as Boolean
Set cn = New ADODB.Connection
strCN = "driver={SQL Server};DSN=;server=168.128.1.5;database=Pubs;uid=user;pwd=;"
cn.ConnectionTimeout = 10
cn.Open strCN
If cn.State = 1 Then
blnSuccess = True
Else
blnSuccess = False
End If
cn.Close
Set cn = Nothing
#####