招标法中标规定:数据库记录删除问题

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/27 13:35:23
我的DEL.ASP文件内容
<%
on error resume next
Set Conn=Server.CreateObject("ADODB.Connection")
db="../data/aa.mdb"
connstr ="Provider = Microsoft.Jet.OLEDB.4.0; Data Source ="& Server.MapPath(db)
Conn.Open connstr
set rs=server.createobject("adodb.recordset")
id=Request("id")
sort=request("sort")
if sort ="article" then
sql="select * from article where id="&id
else if sort="news" then
sql="select * from news where id="&id
else if sort="technic"then
sql="select * from technic where id="&id
else if sort="reptechnic"then
sql="select * from replytechnic where id="&id
else if sort="repnews"then
sql="select * from replynews where id="&id
else if sort="reparticle"then
sql="select * from replyarticle where id="&id
end if
end if
end if
end if
end if
end if
%>
<%
rs.open sql,conn,2,3%>

<%rs.delete
rs.update
%>
<%rs.close
conn.close
%>
我用del.asp?id=1&sort=article 或者sort=news ,sort=technic可以删除记录
用sort=reparticle sort=reptechnic sort=repnews都删不掉记录?
怎么回事 ?

if then else这段代码用得不太恰当。格式这样写试试:
if sort ="article" then
sql="select * from article where id="&id
elseif sort="news" then
sql="select * from news where id="&id
elseif sort="technic"then
sql="select * from technic where id="&id
elseif sort="reptechnic"then
sql="select * from replytechnic where id="&id
elseif sort="repnews"then
sql="select * from replynews where id="&id
elseif sort="reparticle"then
sql="select * from replyarticle where id="&id
end if