ASP 删除命令怎么不能实现啊

来源:百度知道 编辑:UC知道 时间:2024/06/17 13:43:26
If not isempty(Request("chkNum")) Then
strTemp = Request("chkNum")
if instr(strTemp,",")>0 then
dim ArrStudentNum
ArrStudentNum = split(strTemp,",")
dim id
For i = LBound(ArrStudentNum) To UBound(ArrStudentNum)
id=ArrStudentNum(i)
call DelRecord(id)
next
else
call DelRecord(strTemp)
end if
else
response.write "没有选中任何记录!"
End If

这是选中的记录被删除的命令,可是只能删除一条记录,哪位帮看一下啊

你的DelRecord(id)是怎么写的,是不是
conn.execute("delete from tablename where id=" & id)

那你也太无聊了,直接
conn.execute("delete from tablename where id in (" & id & ")")不就得了!还得去弄什么循环!

看看split生成的ArrStudentNum()都有些什么
是不是和你想要删除的东西一样

DelRecord这个function呢