[讨论]级联删除代码问题(实习)
close database allthisform.text1.setfocus()
isempty1=allt(thisform.text1.value)
if isempty1==''
=messagebox("请输入专业代码!",64,"提示窗口")
else
use zyxx.dbf
locate for zyxx.专业名称=isempty1
if found()
use xsxx.dbf
select xsxx.学号 as 学号 from xsxx innter join zyxx on xsxx.;专业代码 =zyxx.专业代码 where zyxx.专业名称 =isempty1 into cursor temptable
a=messagebox("真的要删除这些记录么?",4+64,"提示窗口")
if a=6
delete from xsxx.dbf where xsxx.专业代码 in(select zyxx.专;业代码 from zyxx.dbf where zyxx.专业名称=isempty1)
use
pack
close all table
a=messagebox("要删除学生奖惩信息表里的相关记录么?",4+64,";提示窗口")
if a=6
use xsjfxx.dbf
delete from xsjfxx.dbf where xsjfxx.学号 in(select * ;from temptable)
use xsjfxx excl
use
endif
a=messagebox("要删除学生费用信息表里的相关记录么?",4+64,";提示窗口")
if a=6
use ssgl!xsfyxx.dbf
delete from xsfyxx.dbf where xsfyxx.学号 in(select * ;from temptable)
use xsfyxx excl
use
endif
a=messagebox("要删除学生贷款信息表里的相关记录么?",4+64,";提示窗口")
if a=6
use ssgl!xsdkxx.dbf
delete from xsdkxx.dbf where xsdkxx.学号 in(select * ;from temptable)
use
use xsdkxx excl
endif
endif
thisform.text1.value=''
thisform.text1.setfocus()
else
=messagebox("查询无此专业!",64,"提示窗口")
thisform.text1.value=''
thisform.text1.setfocus()
endif
close all database
endif
红色标记错误为“该表正在使用”
浅蓝色部分为sql查询出错