Delphi DBGrid右键删除行并提交至数据库.
在form上添加,控件TPopupMenu,并指定右键名称:删行

2.编写删除语句:   

    If ADOQuery1.State in [dsEdit, dsInsert] then ADOQuery1.Post;
    If ADOQuery1.RecordCount <> 0 then ADOQuery1.Delete;

3.把dbgrid的PopupMenu属性,设置成刚刚添加的控件TPopupMenu。

4.编译,运行

相关文章:

  • 2021-10-03
  • 2022-01-28
  • 2021-12-06
  • 2021-12-26
  • 2021-07-10
  • 2021-09-01
  • 2021-05-16
  • 2022-01-25
猜你喜欢
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2022-02-28
  • 2021-08-17
  • 2021-11-20
  • 2021-07-11
相关资源
相似解决方案