Re: Delphi handling of SQL server generated errors



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

.



Relevant Pages

  • Re: Access 2007->SQL Server2005 "connection was forcibly closed",G
    ... I think it will ameliorate the situation if you clean up the client as ... And to come back to my problem: I think with help of the SQL Server admins ... closed connections - but all of these errors are in the version which used ... Every new client opens again 30 connections if I open 30 tables ...
    (microsoft.public.sqlserver.connect)
  • Re: Best way to populate webpages from multiple tables
    ... tables within hash tables, custom classes etc. ... > Set a session expiring cookie at the client that stores the Customer ID. ... > send it to the client, instead store it in your session mgmt sql server - ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Best way to populate webpages from multiple tables
    ... tables within hash tables, custom classes etc. ... > Set a session expiring cookie at the client that stores the Customer ID. ... > send it to the client, instead store it in your session mgmt sql server - ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Access 2007->SQL Server2005 "connection was forcibly closed",G
    ... an Access database in former times this was a lot of work which took me ... closed connections - but all of these errors are in the version which used ... the SQL Server 2000 and everything worked ... client for programming easy, fast and good applications. ...
    (microsoft.public.sqlserver.connect)
  • Re: SQL and Bandwidth use
    ... In addition to the other responses, take a look at the memory and CPU usage ... in Great Plains Client software. ... > near 100Mb/sec bandwidth). ... Client PC is on same segment as SQL server (not passing through ...
    (microsoft.public.sqlserver.server)