 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
felik Guest
|
Posted: Tue Mar 28, 2006 8:04 am Post subject: trigger error |
|
|
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
|
Posted: Wed Mar 29, 2006 4:03 am Post subject: Re: trigger error |
|
|
| 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
|
Posted: Wed Mar 29, 2006 9:03 am Post subject: Re: trigger error |
|
|
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
|
Posted: Thu Mar 30, 2006 4:03 am Post subject: Re: trigger error |
|
|
| 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 |
|
 |
|
|
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
|
|