PC Review


Reply
Thread Tools Rate Thread

ConnectionString Timeout After 60 seconds

 
 
Joe K.
Guest
Posts: n/a
 
      14th Dec 2007

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

 
Reply With Quote
 
 
 
 
Tim Zych
Guest
Posts: n/a
 
      14th Dec 2007
Use CommandTimout instead.

conn.CommandTimeout = 120 ' or whatever

The default is 30.


--
Tim Zych
SF, CA

"Joe K." <Joe K.@discussions.microsoft.com> wrote in message
news:2228D055-9AF8-41F2-AA95-(E-Mail Removed)...
>
> 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
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session.Timeout after 20 seconds not working Astrix Microsoft ASP .NET 6 17th Jul 2007 04:18 PM
TIMEOUT in 5 Seconds FP2002 when publishing =?Utf-8?B?VGV4YXNXaW5n?= Microsoft Frontpage 5 26th Apr 2006 04:45 AM
Timeout expired - solve via ConnectionString? =?Utf-8?B?TWFyaw==?= Microsoft ADO .NET 8 25th Apr 2005 05:14 PM
send timeout after 2 seconds Gary Microsoft Outlook Fax 1 24th Apr 2004 02:23 PM
ODBC Timeout is always 15 Seconds Peter Stojkovic Microsoft VB .NET 2 13th Nov 2003 06:20 PM


Features
 

Advertising
 

Newsgroups
 


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