Board index » delphi » TQuery Hangs on MS SQL Server error

TQuery Hangs on MS SQL Server error

Any time an MS SQL Server error is generated durning any TQuery
transaction, Delphi hangs. THis happens even for instances where I have
specifically coded a RAISERROR statement in a stored procedure and then
called that stored procedure using a TQuery. Is there any way to trap these
server-generated errors?

 

Re:TQuery Hangs on MS SQL Server error


Quote
"Chris Margraff" <ch...@microgal.com> wrote:
>Any time an MS SQL Server error is generated durning any TQuery
>transaction, Delphi hangs. THis happens even for instances where I have
>specifically coded a RAISERROR statement in a stored procedure and then
>called that stored procedure using a TQuery. Is there any way to trap these
>server-generated errors?

Usually I do the following:

With MyQuery Do Begin
  SQL.Add (.....)
  try
    Open;
  except
     SQL.SaveToFile ('_error.sql');
    raise
  end;
  ...
  Close
End;

So you can easily test the saved sql-statement in ISQL. You also might
want to verify the MAX QUERY TIME parameter in the ALIAS definition.

Regards

Marcus

Other Threads