문제

I am in a BeforePost event handler hoping to cancel the post before it goes through. At the end of my BeforePost function I call DataSet->Cancel(); and when debugging through this I see it go from my function to the TDataSet.DoBeforePost function then to the TDataSet.Post; where it calls CheckOperation(). CheckOperation throws an exception (which I tried to avoid by calling Cancel() ) because the data is incorrectly entered and the user sees this error.

Is there something in this order of operations that I am doing wrong? Any kind of ideas or guidance would be greatly appreciated.

도움이 되었습니까?

해결책

If I remember correctly then you should use Abort() instead of Cancel();

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top