Re: How do I capture Delphi 5 TADODataset timeout error consistently?



I've noticed some other interesting behavior with the TADODataset in
Delphi 5. When I run a query that executes a stored procedure, the
commandtimeout usually gets used (whether it throws and exception or
not). If I just run straight SQL text that returns a large dataset,
such as "SELECT about10millionrecords from MyDB.dbo.MyTable", the app
just hangs, and never seems to continue past the code that activates
the query.

Thanks.

casman53024 wrote:
> I am using Delphi 5, hitting a SQL Server 2000 database.
>
> I have a simple reporting application that uses a TADODataset to run
> various SQL queries and put the results into a TListView. It uses a
> registry entry to modify the commandtimeout property of the
> TADODataset. I use the following code to attempt to capture the
> timeout error if one occurs:
>
> {lDSMain is a TADODataset object}
> lDSMain.CommandText := SomeSQLText5;
> lDSMain.CommandTimeout := GetADOTimeout; {gets value from
> registry, else 300 }
> try
> lDSMain.Active := true;
> except
> on E: Exception do begin
> MessageDlg(E.Message, mtInformation,[mbOk], 0);
> Exit;
> end;
> end;
>
> After lDSMain runs, it loops through its datasets, assigning each to
> another TADODataset object, and displaying the contents of each.
>
> The trouble is, it doesn't always cause an exception when it times out.
> If the timeout does not get recognized, it continues into the section
> that is trying to loop through the datasets, and then causes an E_FAIL
> Status error.
>
> Is there an explanation for this behavior, or a better way to capture
> the SQL timeout?
>
> Thanks.

.



Relevant Pages

  • How do I capture Delphi 5 TADODataset timeout error consistently?
    ... hitting a SQL Server 2000 database. ... I have a simple reporting application that uses a TADODataset to run ... After lDSMain runs, it loops through its datasets, assigning each to ... If the timeout does not get recognized, ...
    (borland.public.delphi.database.ado)
  • Re: TADOStoredProc
    ... From D2006 the SQL is of type TWideStrings class. ... if they will use TADOCommand & TADODataSet. ... TADOCommand & TADODataSet usage will give you more explicit / natural control on recorset manipulations, briefcase model, persistence, ... ASA, Interbase/Firebird, DbExpress, ODBC data access engine ...
    (borland.public.delphi.database.ado)
  • Re: DisableControls doesnt disable controls
    ... >Database Componnent: TADODataSet ... Well I can't produce any problem using the code you posted with D7 and SQL ... server 2000. ...
    (borland.public.delphi.database.ado)
  • Using TADODataset
    ... Are there any advantages to using the IndexFieldNames and IndexName property ... of the TADODataset versus just writing the SQL the way you want your result ...
    (borland.public.delphi.database.ado)
  • Re: Creating a linked table programmatically
    ... >I am able to set up a TADODataset as I am understanding from your ... Linking means you have two TadoDatasets where the records in the linked dataset ... or you have linked servers. ... You will have to write the SQL in your code so you ...
    (borland.public.delphi.database.ado)