procedure TEventForm.Thatsanono(DataSet: TDataSet);

procedure TEventForm.Thatsanono(DataSet: TDataSet);
begin
inherited;
Abort;
end;

Assigned to the BeforeDelete and BeforeInsert events on a ClientDataSet.

Comments

  1. Well, since TClientDataSet doesn't have a "ThatsANoNo" method (the name alone is a WTF), the inherited call is useless at best. I can get behind handing the two events since it's for a grid that's only supposed to allow editing one particular column, while giving an otherwise read only view of a particular table. Though I'm not sure how one would manage to pull off an Insert or Append since there's no UI (exposed or hidden) on the form to allow that. It's just unusually defensive coding for no purpose.

    ReplyDelete
  2. Anthony Frazier It is not TClientDataSet.ThatsANoNo which is called, it is TEventForm.Thatsanono! There is some chance for an inherited method in case the form is visually inherited itself.

    ReplyDelete
  3. Uwe Raabe You're right, my mistake. I know better. Though there's no such event in the Form's hierarchy either.

    ReplyDelete

Post a Comment