Subject Re: [IBO] Foreign Key Constraint Exception Handling in Datagrid
Author Helen Borrie
At 02:13 AM 16/01/2004 +0000, you wrote:
>Hi Guys,
>I'm having trouble with the auto update feature of the TIB_Datagrid

Tib_Datagrid? auto update feature?

>I want to catch the exception raised when a foreign key constraint
>is violated. How can I do this? I have discovered the onError
>function of the TIB_Query, and I and instruct the exception not the
>be raised by setting the RaiseException variable to be false,

Well, killing the messenger doesn't solve the problem...

>however the proceedure will then continue be cause the exception
>wasn't caught it was just silenced.

If you silence an exception, it doesn't cause the error to be fixed by
magic. The idea is NOT to kill the exception but to *catch* it and provide
the user with the opportunity to fix it.

Whatever happens, the server isn't going to allow you to post a record that
causes a foreign key violation. The purpose of exceptions is to signal
that fact to the application. So, if your application provides users with
the ability to create FK violations then it must "listen" for this
exception and provide a solution.

The detail of that solution I cannot suggest, not knowing what the
application is doing that permits the exception to occur...