On Thu, Mar 24, 2011 at 9:50 PM, <[email protected]> wrote:
> There is to my knowledge no cross-database way.
> For firebird, we analyse the error message, find the table name, and then
> display a nice error to the user. Something like
> "Cannot delete this item: there is still related information in table XYZ"
I use a similar technique with Firebird (in a project not using tiOPF). I
check the exception message for the text "violation of FOREIGN KEY
constraint" and by checking the foreign key name in the message I know which
foreign key is the problem and construct an appropriate error message for
the user.
When you detect a FK violation you need to know:
- the operation that you are performing: insert, update or delete.
- which class/table the operation is being performed on.
This allows you to determine if the problem is a) deleting a school lookup
entry when there are schools that still reference it, or b) inserting a new
school when someone just deleted the lookup entry. These would have
different error messages.
Regards,
Jarrod Hollingworth
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
tiOPF-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tiopf-talk