Unclear error message
Posted: Tue 01 Mar 2016 09:00
I am working on an application with IBDAC where a new record is appended to a table and the on post an exception was thrown that statet "Operarion aborted".
After debugging into the heart of the matter I found out that the error was caused by a primary key violation that raises the correct exception in
in Data.DB. But the exception I get is "Operation aborted". This seems to be related to IBDAC as with UNIDAC I got the correct exception cause.
After debugging into the heart of the matter I found out that the error was caused by a primary key violation that raises the correct exception in
Code: Select all
procedure TDataSet.CheckRequiredFields;
var
I: Integer;
begin
for I := 0 to FFields.Count - 1 do
[b] if FFields[I].Required and not FFields[I].ReadOnly and (FFields[I].FieldKind = fkData) and FFields[I].IsNull then[/b]
begin
FFields[I].FocusControl;
DatabaseErrorFmt(SFieldRequired, [FFields[I].DisplayName]);
end;
end;