Why isn't ADOExpress throwing an exception on error?



i have a trigger on an SQL Server table
CREATE TRIGGER CheckQuoteNumberMatchesProjectNumber ON dbo.Quotes
FOR INSERT, UPDATE AS
raiserror('dummy', 16, 1)


i then run the code:
procedure TfrmMain.Label2Click(Sender: TObject);
var
qry: TADOQuery;
begin
qry := TADOQuery.Create(nil);
qry.Connection := Conn;
qry.SQL.Text :=
'UPDATE Quotes'+CRLF+
'SET QuoteNumber = ''Q50288-3'''+CRLF+
'WHERE QuoteNumber = ''Q50288-3''';
qry.ExecSQL;
end;


And i get no exception thrown. If i create a new table, with the same
trigger, an exception is thrown. In both cases SQL Server is returning the
error. i can see the error coming back if i packet trace.


HOWEVER
If i run the code:


procedure TfrmMain.Label2Click(Sender: TObject);
var
RecordsAffected: Integer;
szQuery: string;
begin
szQuery :=
'UPDATE Quotes'+CRLF+
'SET QuoteNumber = ''Q50288-3'''+CRLF+
'WHERE QuoteNumber = ''Q50288-3''';

Connection.Execute(szQuery, RecordsAffected);
end;


i DO get an exception thrown.

What is Borland's wrapper around ADO doing to eat the error?


.



Relevant Pages

  • Re: Records not inserting...
    ... > I am totally new to SQL server. ... However, in a trigger, would I be ... test the effects of certain data modifications and to set conditions for ... UPDATE statements. ...
    (microsoft.public.sqlserver.odbc)
  • Re: Help for an Oracle Newbie
    ... application I wrote using SQL Server ported over to Oracle. ... Obviously there are several built in data types in SQL Server that do ... Of course I had to use a different name for the trigger under each ...
    (comp.databases.oracle.server)
  • Re: TRIGGER (AFTER INSERT) and Store Procedure ... insert failed !
    ... >into SQL server, the record exist anyway! ... >If you refresh the data you will see the record... ... it gets refreshed after trigger excecution automatically. ... I don't know your monitoring system, but I guess that removing the result ...
    (microsoft.public.sqlserver.programming)
  • Re: Access Bug with SQL Server identity columns
    ... Even though SQL Server since version 2000 has had a reliable ... The work-around I've always used is to make sure that no trigger inserts into ... a table that contains an IDENTITY column, and use some other unique identifier ... >create a form on table1 with a subform on table2. ...
    (comp.databases.ms-access)
  • Re: Help for an Oracle Newbie
    ... application I wrote using SQL Server ported over to Oracle. ... Obviously there are several built in data types in SQL Server that do ... Of course I had to use a different name for the trigger under each ... In SQL Server I always create a CreatedDate column ...
    (comp.databases.oracle.server)