Re: Delphi handling of SQL server generated errors
- From: Metal Dave <metal@xxxxxxxxx>
- Date: Thu, 21 Apr 2005 18:06:26 -0400
On Thu, 21 Apr 2005 17:39:01 -0400, Metal Dave <metal@xxxxxxxxx>
wrote:
>On Wed, 20 Apr 2005 17:59:43 -0400, Metal Dave <metal@xxxxxxxxx>
>wrote:
>
>>As I understand it, Delphi should raise an Exception whenever a client
>>app that is connected to an SQL Server runs an SQL statment that
>>fails. Anotherwords, whenever SQL Server rasies an error using the
>>"raiserror" statement in SQL Delphi should raise an exception in the
>>client application. However I noticed some unexpected behavior when
>>running some SQL scripts that caused errors, and have reduced the
[...]
>I found a post online regarding a similar problem that suggested the
>following solution:
>
>Make sure you have SET NOCOUNT ON at the beginning of your procs and
>triggers. This will suppress DONE_IN_PROC messages that are returned
>as empty closed recordsets in ADO.
>
>A simple test confirms that adding this statement to the begining of
>the batch works. However I'm not sure if editing every script to put
>that in is an option. Alternatively, I'd like to access the underlying
>ado properties to set the property "IGNORE_DONE_IN_PROC" to true.
>However I've tried both:
Well as it turns out, IGNORE_DONE_IN_PROC is a jdbc concept not ADO
but I believe just performing
fCommand.CommandText := 'SET NOCOUNT ON' + EOL + fCommand.CommandText;
before execcution in all relevant portions of code will probably solve
my problem. If anyone else has anything to add that'd be great but
apparently all I needed to do was rant to myself on usenet for a
couple of days to solve the problem. Cheers!
Dave
.
- References:
- Delphi handling of SQL server generated errors
- From: Metal Dave
- Re: Delphi handling of SQL server generated errors
- From: Metal Dave
- Delphi handling of SQL server generated errors
- Prev by Date: Re: Delphi handling of SQL server generated errors
- Next by Date: How to realize art word in Delphi without using MS word.
- Previous by thread: Re: Delphi handling of SQL server generated errors
- Next by thread: TIBQuery2.Assign(TIBQuery1) doesn't work
- Index(es):
Relevant Pages
|