下面的代码是一个网友写的,不知对你是否有帮助
表缓冲模式为5时无法pack
解决思路为,更改缓冲模式为1,pack完再改回去
要求表为独占方式打开
删除按钮的click事件代码如下:
IF this.Caption="删除"
YN=MESSAGEBOX("确认删除?",4+32,"用户管理")
IF YN=6
*!* DELETE
*!* PACK 表缓冲不能pack
SET FILTER TO !deleted()
DELETE
&&SET DELETED ON
if delete()
if !eof()
skip
else
if recno()>1
skip -1
endif
endif
ENDIF
thisform.Refresh
*!* thisform.grid1.Refresh
&&thisform.checkempty
ENDIF
*!* tablerevert(.t.) &&放弃修改
= TABLEUPDATE(.T.) && 提交修改.
=CURSORSETPROP('Buffering',1,ALIAS( ))&&该缓冲模式才能用pack
Pack
=CURSORSETPROP('Buffering',5,ALIAS( ))&&改回缓冲模式
endif