Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to detect ADO CommandTimeout
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00469628
Message ID:
00469980
Vues:
30
>I am using the CommandTimeout property on an ADO connection in Visual Basic to prevent queries to my FoxPro tables from running too long. This seems to work, but I need a way to determine whether a query ran to completion or timed out. I tried using the ADO event ExecuteComplete, but adStatus is always adStatusOk. I also tried running the query asynchronously (see MS knowbase article Q190606), but I get the error Current provider does not support asynchronous execution. Does anyone have an idea or a work around?
>
>Thanks!

Hi Tim,

I have been working with ADO data for a few months now, and reading the platform SDK docs more than I'd like to for ADO object properties and such! From reading the SDK docs about the CommandTimeout property, it seems that you would get a returned error if the command times out. I know this is not what you want, but it seems like you'd know it if it happened. Probably something would show up in the Errors collection of your ADOConnection object.

**snip SDK ADO docs.
Use the CommandTimeout property on a Connection object or Command object to allow the cancellation of an Execute method call, due to delays from network traffic or heavy server use. 

****** right here is why I say this!
If the interval set in the CommandTimeout property elapses before the command completes execution, an error occurs and ADO cancels the command. 
******

If you set the property to zero, ADO will wait indefinitely until the execution is complete. Make sure the provider and data source to which you are writing code support the CommandTimeout functionality.
Might be no help, its just what I have found.

Jim
Jim Newsom
IT Director, ICG Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform