关闭

dbcancel,reset,reselectrow

1360人阅读 评论(0) 收藏 举报
从库中重新检索数据,并更新当前行的显示和状态
This statement reselects the clicked row if the update is not successful:
更新失败后,重前检索该数据
IF dw_emp.Update( ) < 0 THEN

        dw_emp.ReselectRow(dw_emp.GetClickedRow())

END IF
reset
清除数据窗口中的所有数据(不影响数据库中数据)
In a DataWindow whose Retrieve As Needed option is on, this example cancels the retrieval before resetting the DataWindow:
dw_employee.DBCancel()
dw_employee.Reset()   撤消数据查询,并清空当前绶冲区

应用二
不断动态指定  dataobject时,
用于清除先前数据的绶冲区



RowsDiscard
Use RowsDiscard when your application is finished with some of the rows in a DataWindow control and you don't want an update to affect the rows in the database. For example, you can discard rows in the delete buffer, which prevents the rows from being deleted when you call Update.

This statement discards all the rows in the delete buffer for dw_1. As a result if the application later calls dw_1.Update(), the DataWindow will not submit SQL DELETE statements to the DBMS for these rows:
dw_1.RowsDiscard(1, dw_1.DeletedCount(), Delete!)
进行假删除,在数据窗口中删除,而数据库中并不删除
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:229739次
    • 积分:3891
    • 等级:
    • 排名:第8414名
    • 原创:137篇
    • 转载:21篇
    • 译文:9篇
    • 评论:9条
    最新评论