 |
| SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 27th, 2006, 07:52 AM
|
|
Registered User
|
|
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error:-2147217871 Timeout expired
Hi everyone,
I have a application in which some processing of files is done. When the processing is carried, the same is interrupted by the error
"Error:-2147217871 Timeout Expired"
My application is connected to the database on sql server 2000.
Please some one help me out with this. This is a client side exception and you people can imagine my position right now!! 
|
|

June 27th, 2006, 03:40 PM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Set CommandTimeout to a larger value.
|
|

June 27th, 2006, 11:45 PM
|
|
Registered User
|
|
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Can you be more specific on this please?
|
|

June 28th, 2006, 01:19 AM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
If you are using ADO to connect to SQL Server, there is a property named CommandTimeout. Default is, I think, 30 seconds. Set this property to 300 for 5 minutes.
|
|

June 30th, 2006, 04:48 AM
|
|
Registered User
|
|
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Peso.It has been very helpful for me!!  :)
|
|

June 30th, 2006, 05:08 AM
|
|
Registered User
|
|
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Also could you tell me where should i make these settings??
Please??
|
|

June 30th, 2006, 06:12 AM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
When you create your command object, set the obj.CommandTimeout to 300
Obj.CommantTimeOut = 300
|
|

November 22nd, 2006, 08:43 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
HI
I have the following code for calling a Stored procedure, which is calculation intensive. Although I have increased all possible timeouts, it still gives me Timeout Expired -214721787 error
************************************************** ***********
Set RS = New ADODB.Recordset
Set cmd = New ADODB.Command
'Init the ADO objects
cmd.ActiveConnection = gsConnectionString
cmd.CommandTimeout = 0
cmd.CommandText = strSP
cmd.CommandType = adCmdStoredProc
'Create the stored proc parameters
CreateParams cmd, varParams
' Execute the query for readonly
RS.CursorLocation = adUseClient
RS.CacheSize = 500
RS.Open cmd, , adOpenForwardOnly, adLockReadOnly
' Disconnect the recordset
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
Set RS.ActiveConnection = Nothing
' Return the disconnected recordset
Set gdbrsRunSPReturnRS = RS
Set RS = Nothing
************************************************** ***********
what can be done to resolve the issue?
|
|

November 22nd, 2006, 10:33 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
|
|
You'll also get the timeout message if someone already has a lock on the SQL objects in the form of uncommitted updates or inserts. I also think that increasing the timeout to more than 30 seconds is just a band-aid for a much larger more serious problem. It could be transaction leaks (someone forgot to commit or rollback), poorly formed SQL, a bad database design, missing indexes, etc, etc. I'd start looking for what the actual cause of the timeout is because 30 seconds is more than anyone should have to wait in an app...
--Jeff Moden
|
|

November 22nd, 2006, 10:35 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
|
|
Quote:
quote:Originally posted by architsureka
HI
I have the following code for calling a Stored procedure, which is calculation intensive. Although I have increased all possible timeouts, it still gives me Timeout Expired -214721787 error...
|
Post the proc so folks can take a look at it...
--Jeff Moden
|
|
 |