如何判断一个Datawindow中的数据是否修改过。

lia 2002-08-16 09:55:21
如何判断一个Datawindow中的数据是否修改过。
...全文
174 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
zxl19790710 2002-08-16
  • 打赏
  • 举报
回复
dw.modifiedcount() + dw.insertedcount() > 0
海洋‘s 2002-08-16
  • 打赏
  • 举报
回复
在窗口的CloseQuery()事件中写代码判断:
integer li_rc
integer li_row

// Accept the last data entered into the datawindow
dw_master.AcceptText()
//Check to see if any data has changed
IF dw_master.ModifiedCount() > 0 THEN
li_rc = MessageBox("关闭提示","您已经对数据库做了修改,保存您所做的修改吗", Question!, &
YesNoCancel!, 3)

//User chose to up data and close window
IF li_rc = 1 THEN
Window lw_window
lw_window = w_frame.GetActiveSheet()

lw_window.TriggerEvent("ue_update")
RETURN 0

//User chose to close window without updating
ELSEIF li_rc = 2 THEN
RETURN 0

//User canceled
ELSE
RETURN 1
END IF

ELSE
// No changes to the data, window will just close
RETURN 0

END IF
sulo_xxr 2002-08-16
  • 打赏
  • 举报
回复
dw.modifiedcount() + dw.insertedcount() > 0 表示修改过,或删除过
uno 2002-08-16
  • 打赏
  • 举报
回复
一楼的
又用update
又用commit
真是别扭
xirumin 2002-08-16
  • 打赏
  • 举报
回复
if dw.modifiedcount() + dw.insertedcount() > 0 then
xingxing 2002-08-16
  • 打赏
  • 举报
回复
if dw_1.modifiedcound + dw_1.deletecount > 0 then
...
end if
xiongxiao 2002-08-16
  • 打赏
  • 举报
回复
如上
shuyf2000 2002-08-16
  • 打赏
  • 举报
回复
GetModifiedCount()函数能使用,例:
if dw_1.GetModifiedCount() > 0 then
dw_1.update()
commit;
end if

611

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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