Mike
30-Mar-2006, 08:30 AM
How to handle errors from EDatabaseError class?
For example I want to catch
'DataSet: Field 'DataSetField' not found'
and
'Cannot modify a read-only dataset'.
How to do that?
Below is the method this I am using but I think it should be better way.
if (EurekaExceptionRecord.ExceptionObject is EDatabaseError) then
begin
msg := Exception(EurekaExceptionRecord.ExceptionObject).M essage;
if POS('Cannot modify a read-only dataset', msg) <> 0 then
begin
Handled := false;
MyAction....
end;
end;
Mike.
For example I want to catch
'DataSet: Field 'DataSetField' not found'
and
'Cannot modify a read-only dataset'.
How to do that?
Below is the method this I am using but I think it should be better way.
if (EurekaExceptionRecord.ExceptionObject is EDatabaseError) then
begin
msg := Exception(EurekaExceptionRecord.ExceptionObject).M essage;
if POS('Cannot modify a read-only dataset', msg) <> 0 then
begin
Handled := false;
MyAction....
end;
end;
Mike.