hu9jj老师,你看一下我这段程序有没有错误?我用的是数据环境加载数据表
ldwbh=alltrim(thisform.Pageframe1.Page2.txtDwbh.value)
cmessagetitle='医疗保险管理系统'
cmessagetext='确定要删除吗?'
ndialogtype=4+32
nAnswer=messagebox(cmessagetext,ndialogtype,cmessagetitle)
SELECT DW
*GO thisform.rec
if nAnswer=6
thisform.Pageframe1.Page1.grdDw.RecordSource=null
use data/dw exclusive
&&以独占方式打开数据表
GO thisform.rec
dele
&&逻辑删除记录
*dele from dw where empty(dwMC)
pack
&&物理删除
*messagebox('删除完毕',48,'操作成功!')
*thisform.Pageframe1.Page1.grdDw.RecordSourceType=1
*thisform.Pageframe1.Page1.grdDw.RecordSource="dw"
GO top
thisform.Pageframe1.Page2.txtDwbh.value=dw.dwbh
thisform.Pageframe1.Page2.txtDwmc.value=dw.dwmc
thisform.Pageframe1.Page2.txtDwlxr.value=dw.dwlxr
thisform.Pageframe1.Page2.txtDwlxrdh.value=dw.dwlxrdh
thisform.Pageframe1.Page2.txtDwdz.value=dw.dwdz
thisform.Pageframe1.Page2.Refresh
&&刷新表单
ENDIF
select dwbh as 单位编号,dwmc as 单位名称,dwlxr as 单位联系人,dwlxrdh as 联系人电话,dwdz as 单位地址 FROM dw ORDER BY dwbh into cursor lsdw
thisform.Pageframe1.Page1.grdDw.RecordSource="dw"
thisform.Pageframe1.Page1.Refresh
&&刷新表单
thisform.Refresh
messagebox('删除完毕',48,'操作成功!')
use