BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

trigger error

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
felik
Guest





PostPosted: Tue Mar 28, 2006 8:04 am    Post subject: trigger error Reply with quote



hi,

i've db trigger (SQL Server) in my table.
but if there is an error in executing that trigger, my delphi application dont get that error, why?
how to get error message from trigger.

i use D5 and ADODB

pls help


thx
Back to top
Brian Bushay TeamB
Guest





PostPosted: Wed Mar 29, 2006 4:03 am    Post subject: Re: trigger error Reply with quote



Quote:
i've db trigger (SQL Server) in my table.
but if there is an error in executing that trigger, my delphi application dont get that error, why?
how to get error message from trigger.

i use D5 and ADODB

pls help

What is the error? If you are using RaiseError in your trigger to generate an
error you probably have not set the severity high enough to trigger an error in
delphi.

Are you running the SQL that first the trigger inside a Try/fail block?
That will also suppress an error
--
Brian Bushay (TeamB)
Bbushay (AT) NMPLS (DOT) com
Back to top
felik
Guest





PostPosted: Wed Mar 29, 2006 9:03 am    Post subject: Re: trigger error Reply with quote



Brian Bushay TeamB <BBushay (AT) Nmpls (DOT) com> wrote:
Quote:

i've db trigger (SQL Server) in my table.
but if there is an error in executing that trigger, my delphi application dont get that error, why?
how to get error message from trigger.

i use D5 and ADODB

pls help

What is the error? If you are using RaiseError in your trigger to generate an
error you probably have not set the severity high enough to trigger an error in
delphi.

Are you running the SQL that first the trigger inside a Try/fail block?
That will also suppress an error
--
Brian Bushay (TeamB)
Bbushay (AT) NMPLS (DOT) com

hi,

here is my code:

ADOConnection.BeginTrans;
try
//update "order" table using stored procedure
//this "order" table has trigger to update "inventory" table
//but there is an error when updating "inventory" table
//the error is relationship between other table
//the question is why i can trap that error?
//thx


except
on E: Exception do
begin
ADOConnection.RollbackTrans;
MessageDlg(E.Message, mtError , [mbOk], 0);
end
end


thx a lot
Back to top
Brian Bushay TeamB
Guest





PostPosted: Thu Mar 30, 2006 4:03 am    Post subject: Re: trigger error Reply with quote

Quote:
hi,

here is my code:

ADOConnection.BeginTrans;
try
//update "order" table using stored procedure
//this "order" table has trigger to update "inventory" table
//but there is an error when updating "inventory" table
//the error is relationship between other table
//the question is why i can trap that error?
//thx


except
on E: Exception do
begin
ADOConnection.RollbackTrans;
MessageDlg(E.Message, mtError , [mbOk], 0);
end
end

I don't see anything wrong in the delphi code assuming you actually see the
messageDlg box.
That means your stored procedure is not triggering a critical error.

You can try checking the AdoConnection.errors collection at the begriming of
the Exception code to look for errors that are not critical
--
Brian Bushay (TeamB)
Bbushay (AT) NMPLS (DOT) com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.