Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timeout Expierd

Status
Not open for further replies.

vedicman

Programmer
Sep 5, 2003
128
US
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
 
This probably belongs on the vb forum or whatever language this is written in. However, I should point out to you that you should NEVER connect as sa with no password, it is asking for hackers to get into your system. If you have no passwoird on sa right now, put one on it immediately! Also create a login to use for the connection that DOES NOT have system admin rights!

YOu don;t post the SQL string you created but it is possible that it is invalid. Having a connection that never times out is not usually a good idea either.
 
FYI:

The SQL string runs OK from SQL Query Analyzer.
 
If you have a problem with the script running faste in query analyser than in your application, have a look at disconnected recordsets. ADO can get very slow if your recordset is connected.

IKER
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top