Re: Error Handling Coming Out of a Trigger
- From: "Brian Hollister" <bhollisterATfuturaintlDOTcom>
- Date: Wed, 20 Jun 2007 16:45:13 -0400
Hello Vassiliev,
I tried your suggestion as well but no go on that route either. I am
creating my connections at run-time so what i did was declared a class with
a class function.
type TMyInfoMessageObject = class
class procedure ShowMessage(Connection: TADOConnection;
const Error: Error;
var EventStatus: TEventStatus);
end;
implementation...
class procedure TMyInfoMessageObject.ShowMessage(
Connection: TADOConnection; const Error: Error;
var EventStatus: TEventStatus);
begin
MessageDlg(Error.Description, mtError, [mbOK], 0);
end;
At runtime when the TADOConnection object is created i assigned the class
function like so;
// gets the db connection and tests for connectivity, also catches
Exceptions
function SafeGetDBConnection(var c: TAdoConnection): boolean;
begin
try
c := GetDBConnection; // call out to our dmgrInt unit
c.OnInfoMessage := TMyInfoMessageObject.ShowMessage;
If c.Connected then
result := TRUE
Else
result := FALSE;
except on E: Exception do
result := false;
end;
end;
But i get nothing back. I am just going to go with business rule enforcement
in the front-end, eventually a middle-tier would be nice, and pull as much
as possible out of the database. FYI, i took our Base Form Object and added
Business Rule validation into the Save logic processing. We now eliminated
extraneous trips to the database for both "empty required fields" and "data
range validation checks". The database still has its contraints in place
too...
Thanks,
Brian Hollister
--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com
.
- References:
- Error Handling Coming Out of a Trigger
- From: Brian Hollister
- Re: Error Handling Coming Out of a Trigger
- From: Vassiliev V. V.
- Error Handling Coming Out of a Trigger
- Prev by Date: Re: Error Handling Coming Out of a Trigger
- Next by Date: Re: Error Handling Coming Out of a Trigger
- Previous by thread: Re: Error Handling Coming Out of a Trigger
- Next by thread: Re: Error Handling Coming Out of a Trigger
- Index(es):
Relevant Pages
|