HomeActive Query BuilderSetting Query Timeout (MS SQL-Server 2000)

Setting Query Timeout (MS SQL-Server 2000)


Is there a way I can set the query timeout? I'm using AQB 1.7.9.31 (VCL), Delphi 7, MS-SQL 2000 SP4.
Victor Ulloa
October 30 2007, 08:55 AM
Dear Victor,

It depends on the data access components you use for the VCL Edition. For example, using ADO connection, you may set the ConnectionTimeout property of the TADOConnection object.

The ActiveX Edition has its own ConnectionTimeout property for that purpose.

Sergey
Sergey Smagin | email
20 hours, 15 mins since original post
Sergey:
Thanks for your response. We're trying to set the properties of the connection for our provider, like this:


fDataSet : TAdoDataSet
...
TacADOMetadataProvider(MetadataProvider).Connection.CommandTimeout := 3600; // Or any value above 30 seconds!
fDataset := TAdoDataset(MetadataProvider.ExecSQL(editSQL.Lines.Text)); // editSQL is our TMemo, contains the generated SQL

But when we try to execute any given query, the TADODataset created by executing MetaDataProvider.ExecSQL is always created with a 30 seconds CommandTimeout (default value)But not every query is solved in 30 or less seconds! As a matter of fact, almost every of our queries take 2 to 3 minutes.

Is there any way (other than modifying the source code for ExecSQL) to set the timeout? Or, as a suggestion: maybe you can create datasets with the CommandTimeout value taken from the connection (as a new default value instead of the 30 seconds)?

Thanks
Victor Ulloa | email
1 week, 1 day since original post
Dear Victor,

Thank you for your detailed explanation. I will forward your suggestion about the ExecSQL method to the programmer.

Actually, this is not necessary to use the ExecSQL method. You may simply get the SQL text from the TacQueryBuilder.SQL property and pass it to your own TADODataset component, for which you may set all required properties before SQL query execution.

Sergey
Sergey Smagin | email
1 week, 1 day since original post
This topic is closed