天天看点

PB_删除实现方法

删除方法的一个小分享,当然实现这个功能的方法很多,如果大家那有更优化的方法,请指教!谢谢!

话不多说,代码走起:

//判断如果数据行数为0,则直接给出提示信息
if dw_userinfo_detail.rowcount() = 0 then
	MessageBox('提示','没有可删除数据')
	return
	
else
	String ls_name
	ls_name = dw_userinfo_detail.Object.username[1]
	
	if MessageBox('提示','是否要删除学生'+ls_name+'的信息吗?',Exclamation!,YesNo!) = 1 then
		dw_userinfo_detail.deleterow(1)
	else
		return
	end if
	
	if dw_userinfo_detail.update() = 1 then
		commit;
	else
		MessageBox('提示','删除失败!')
		rollback;
	end if
	
end if

dw_userinfo_list.retrieve('%')