Prueba con el siguiente codigo y nos cuentas si te funciona...
Código Delphi
[-]
try
except
on E: EDBEngineError DO
begin
if E.Errors[0].ErrorCode = 9733 then begin
ShowMessage('No se puede eliminar, hay registros relacionados en la tabla XXX'); end
else
begin
raise; end;
end;