Board index » delphi » CommandTimeout doesnt work

CommandTimeout doesnt work

According to the documentation, you can set CommandTimeout to a certain
number of seconds, and if the query takes longer than that number, it will
stop the query and generate an exception.  I can't seem to make this work no
matter what I do.  I have tried setting it on the ADOConnection object and
the ADOQuery object.  But no exception is ever generated.

Looking at the MSDN documentation, some providers don't support this.  I'm
using the 'Microsoft OLE DB Provider for SQL Server' provider.  Is there
anyway to make this work with that provider?  Also, is there a way to tell
if a provider supports this or not?

Thanks,
David

 

Re:CommandTimeout doesnt work


Quote
> ADOConnection object and
>the ADOQuery object.  But no exception is ever generated.

There is a problem with TadoQuery.commandTimeout with D5
Use TadoDataset.
TadoConnection.CommandTimeout only affects commands executed with
TadoConnection.execute method
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:CommandTimeout doesnt work


Forgot to mention in my first post that I'm using Delphi 6 with the patches
applied.

I tried using a TADODataset with the same results.  No matter what, I never
get an exception when the query takes longer than expected.

I even wrote a stored procedure that loops for like a million times before
sending back a select statement.  This took about 5 seconds to return rows
in the Query Analyzer.  When I set the CommandTimeout to 1 on the
TADODataSet, then set the Active to True, it sat there for around 5 seconds,
then returned True.  I would have expected an exception to be raised.

Is there a bug in the ADO objects themselves?

Thanks for any information on this issue.
David House

"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:itu48v8fcfprriugobfsti5tm0ffpiokdp@4ax.com...

Quote

> > ADOConnection object and
> >the ADOQuery object.  But no exception is ever generated.

> There is a problem with TadoQuery.commandTimeout with D5
> Use TadoDataset.
> TadoConnection.CommandTimeout only affects commands executed with
> TadoConnection.execute method
> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Other Threads