Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VB6 - ADO -SQL timeout expired with large querys

48 views
Skip to first unread message

Nick

unread,
Dec 13, 2002, 11:09:47 AM12/13/02
to
Hi,

We have a problem for who I don't find any solution.

There is a VB6 program with an ADO connection and
recordset to SQL.
The connection is adopenDynamic and adLockOptimistic.

It is a large query.
The program giev following runtime error :
Run-time error '-2147467259(80004005)
Timeout expired.

I'dont' find any reasons.
Is there sombody who have the same problem?

Thanks
Nicky

Ramesh

unread,
Dec 13, 2002, 11:25:40 AM12/13/02
to
Do you have the commandTimeout Setup for this query.
The default commandTimeout is 30 seconds, if your query runs longer it will
timeout.
Please make sure you have the commandTimeout property set and try
increasing the value for commandtimeout.

Hope this helps.

Ramesh Thyagarajan, MCSD,MCDBA
Microsoft Developer support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.

Mike Vandemore

unread,
Dec 14, 2002, 12:48:58 AM12/14/02
to
> It is a large query.

A few other thoughts...

- Run "UPDATE STATISTICS" to make sure the indexes are good.

- Make sure you have an index defined to make the query as effecient
as possible

- Consider specifying the index in you query to ensure SQL uses it

- Perhaps your query is too broad to begin with, or maybe you need to
employ server side temporary tables to do more work on the back end.

Mike Mattix

unread,
Dec 14, 2002, 10:22:46 AM12/14/02
to
In article <6WR9pQsoCHA.2276@cpmsftngxa09>, ram...@online.microsoft.com
says...
just to clarify a bit, the connection has a property .connectiontimeout
which can be set for all activity over this connection whether it be
commands or recordset.open method. the property is set in seconds.
However you should check the query as the other posters have suggested
also. but I know that sometimes you just have a long query,
particularly infrequently used views...

Mike Mattix

0 new messages