I am getting a "Timeout Expired" error while running the using the following connection in an XL code module:
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=MSDASQL.1;User ID=sa; " & _
"Data Source=NetSupport"
cn.ConnectionTimeout = 0
cn.Open
......code to create the SQL string
Set myRs = New ADODB.Recordset
With myRs
.ActiveConnection = cn
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open (strSQL)
End With
The error is thrown on the .Open (strSQL) line.
The Server is obviously ignoring the ConnectionTimeout setting. Does anyone have a solution.
Thanks.....Franco
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=MSDASQL.1;User ID=sa; " & _
"Data Source=NetSupport"
cn.ConnectionTimeout = 0
cn.Open
......code to create the SQL string
Set myRs = New ADODB.Recordset
With myRs
.ActiveConnection = cn
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open (strSQL)
End With
The error is thrown on the .Open (strSQL) line.
The Server is obviously ignoring the ConnectionTimeout setting. Does anyone have a solution.
Thanks.....Franco