这是我做的关于题库录入和试卷生成的一个系统,当我点删除时,他会说文件正在使用,指明是选择题目表,但我不知道该怎么办
注明:组合框是op1,进入维护是command1,退出维护是command2,删除是command3,修改是command4
以下是 进入维护按钮 和 删除按钮的代码:
this.enabled=.f.
thisform.command2.enabled=.t.
thisform.command3.enabled=.t.
thisform.command4.enabled=.t.
thisform.command5.enabled=.f.
thisform.command6.enabled=.f.
thisform.op1.option1.enabled=.f.
thisform.op1.option2.enabled=.f.
thisform.op1.option3.enabled=.f.
thisform.op1.option4.enabled=.f.
thisform.grid1.enabled=.t.
do case
case thisform.op1.value=1
thisform.grid1.recordsource="选择题目表"
thisform.grid1.columncount=9
thisform.grid1.column1.header1.caption="题目编号"
thisform.grid1.column2.header1.caption="章节编号"
thisform.grid1.column3.header1.caption="题型编号"
thisform.grid1.column4.header1.caption="难易编号"
thisform.grid1.column5.header1.caption="题目"
thisform.grid1.column6.header1.caption="A选项"
thisform.grid1.column7.header1.caption="B选项"
thisform.grid1.column8.header1.caption="C选项"
thisform.grid1.column9.header1.caption="D选项"
thisform.grid1.refresh
case thisform.op1.value=2
thisform.grid1.recordsource="填空题目表"
thisform.grid1.columncount=5
thisform.grid1.column1.header1.caption="题目编号"
thisform.grid1.column2.header1.caption="章节编号"
thisform.grid1.column3.header1.caption="题型编号"
thisform.grid1.column4.header1.caption="难易编号"
thisform.grid1.column5.header1.caption="题目"
thisform.grid1.refresh
case thisform.op1.value=3
thisform.grid1.recordsource="简答题目表"
thisform.grid1.columncount=5
thisform.grid1.column1.header1.caption="题目编号"
thisform.grid1.column2.header1.caption="章节编号"
thisform.grid1.column3.header1.caption="题型编号"
thisform.grid1.column4.header1.caption="难易编号"
thisform.grid1.column5.header1.caption="题目"
thisform.grid1.refresh
case thisform.op1.value=4
thisform.grid1.recordsource="应用题目表"
thisform.grid1.columncount=5
thisform.grid1.column1.header1.caption="题目编号"
thisform.grid1.column2.header1.caption="章节编号"
thisform.grid1.column3.header1.caption="题型编号"
thisform.grid1.column4.header1.caption="难易编号"
thisform.grid1.column5.header1.caption="题目"
thisform.grid1.refresh
endcase
删除:
do case
case thisform.op1.value=1
thisform.grid1.recordsource=''
use 选择题目表 exclusive
set order to 题目编号
seek getid
local sure
sure=messagebox("确定删除?",4+32,"提示信息")
if sure=6
delete
pack
thisform.grid1.recordsource="选择题目表"
thisform.grid1.refresh
endif
case thisform.op1.value=2
thisform.grid1.recordsource=''
use 填空题目表 exclusive
set order to 题目编号
seek getid
local sure
sure=messagebox("确定删除?",4+32,"提示信息")
if sure=6
delete
pack
thisform.grid1.recordsource="填空题目表"
thisform.grid1.refresh
endif
case thisform.op1.value=3
thisform.grid1.recordsource=''
use 简答题目表 exclusive
set order to 题目编号
seek getid
local sure
sure=messagebox("确定删除?",4+32,"提示信息")
if sure=6
delete
pack
thisform.grid1.recordsource="简答题目表"
thisform.grid1.refresh
endif
case thisform.op1.value=4
thisform.grid1.recordsource=''
use 应用题目表 exclusive
set order to 题目编号
seek getid
local sure
sure=messagebox("确定删除?",4+32,"提示信息")
if sure=6
delete
pack
thisform.grid1.recordsource="应用题目表"
thisform.grid1.refresh
endif
endcase