Subject Re: [firebird-support] get foreign key
Author Martijn Tonies
Hi,

> hi all, i have this project to build a crm application. my sales order
> table has a foreign key referenced to the customer table. my problem
> is that, everytime i try to delete a customer record, i got this
> "foreign key" exception. how do i know that this customer record is
> not referenced to the sales order record before the user press the
> delete button?
>
> i use firebird 2 and delphi 7
>
> any comments will be highly appreciated

It depends on what you want to do --

Warn the user beforehand, or disable the "Delete" button?

Or catch the exception and let the user know there's a specific
item (eg: sales order) existing and he cannot delete the customer.

Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com