ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ConnectionString Timeout After 60 seconds (https://www.excelbanter.com/excel-programming/402762-connectionstring-timeout-after-60-seconds.html)

Joe K.

ConnectionString Timeout After 60 seconds
 

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


Tim Zych

ConnectionString Timeout After 60 seconds
 
Use CommandTimout instead.

conn.CommandTimeout = 120 ' or whatever

The default is 30.


--
Tim Zych
SF, CA

"Joe K." <Joe wrote in message
...

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





All times are GMT +1. The time now is 09:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com