Delphi: Canceling a TDataSet.Post in an OnBeforePost Event

后端 未结 1 1651
傲寒
傲寒 2021-01-08 00:29

On our main data entry screen, we have an OK/Cancel dialog in the OnBeforePost event.

  • OK lets things take their course
  • Cancel right
相关标签:
1条回答
  • 2021-01-08 00:48

    Calling the method Abort (from the unit System, if I recall correctly) raises a silent EAbort exception, which cancels just the current operation. That should work.

    (Btw: this method of cancelling a databaset operation is also described somewhere deep in the help system as the 'normal' way to achieve this --- that's where I got this technique from originally).

    0 讨论(0)
提交回复
热议问题