Re: Delphi handling of SQL server generated errors



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
[...]
>So my impression is that a delphi component will hide any errors
>raised by an SQL batch run against SQL Server, assuming that the batch
>has had at least one successful insert or select statement previously
>in the batch. Has anyone else noticed anything along these lines?

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:

ADOConnection1.Properties.Item[IGNORE_DONE_IN_PROC'].Value := 'true';

and

ADOCommand1.Properties.Item['IGNORE_DONE_IN_PROC'].Value := 'true';

and both raise an exception message "item cannot be found in the
collection corresponding to the requested name or ordinal".

Any suggestions?

Dave


.



Relevant Pages

  • Re: Recognizing if SQL Server is installed (and what version)
    ... The problem I detect in the question of Rick, is that he is using the word "Error trapping", instead of exception handling; an exception is not always an error. ... The problem with another way of SQL Server checkingis that the registry entries are changing when new versions of SQL Server are released; SQL 2000 version is stored in Microsoft SQL Server\80, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: question about plsql exceptions
    ... When others should be followed by a raise. ... SQL> create unique index idx_t on t; ... We know that a pl/sql block is considered an atomic operation ... Now let's introduce an exception ...
    (comp.databases.oracle.server)
  • RE: Express refuses to install
    ... Loaded DLL:C:\Program Files\Microsoft SQL Server\90\Setup ... Action "LaunchPatchedBootstrapAction" will be skipped due to the following ... Action "InvokeSqlSetupDllAction" threw an exception during execution. ... Aborting queue processing as nested installer has completed ...
    (microsoft.public.sqlserver.setup)
  • Re: App_data - ASPNETDB.MDF
    ... If your hosting provider doesn't support Sql Express version, ... retrieving the user's local application data path. ... Anunhandled exception occurred during the execution of the ... Please make sure theuser has a local user profile ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problem Connecting to SQL
    ... It seems that you are using integrated auth. ... try to change it to SQL auth. ... "Aaron Bellante" wrote in message ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.dotnet.framework.aspnet)