我在adotable控件的Beforedelete事件中想防止用戶刪除記錄,但下面的語句不管用!

aderly 2004-08-06 03:03:50
在beforedelet事件中的代碼
if (ADOTable1.FieldByName('Operatortype_id').AsInteger =8 ) then
begin
ShowMessage('此用戶不能刪除');
ADOTable1.Cancel ;
exit;
end
...全文
68 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
huanyi 2004-08-06
  • 打赏
  • 举报
回复
在beforedelet事件中
huanyi 2004-08-06
  • 打赏
  • 举报
回复
试试
if (ADOTable1.FieldByName('Operatortype_id').AsInteger =8 ) then
begin
ShowMessage('此用戶不能刪除');
Abort;
end
liulovetoo 2004-08-06
  • 打赏
  • 举报
回复
up

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧