ConnectionString Timeout After 60 seconds

J

Joe K.

I am trying to connect to a SQL Server 2005 database using the connection
parameters listed below. After connecting to the SQL Server 2005 database I
execute my sql statement. But I always timeout after approximately 60
seconds. I executed the sql statement within the query analyzer which takes
approximately 90 seconds to complete. Is there something I can add to my
connection parameters listed below so it will not timeout?

Thanks,


Set oConn = New Connection
With oConn

.ConnectionString = "Provider = SQLOLEDB;" & _
"Data Source = " & SOURCE_NAME & ";" & _
"Initial Catalog = " & DB_NAME & ";" & _
"Integrated Security = SSPI"
.ConnectionTimeout = 2000
.Open
End With
 
T

Tim Zych

Use CommandTimout instead.

conn.CommandTimeout = 120 ' or whatever

The default is 30.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top