为什么这种写法可以进入删除数据而不能进行插入数据?
下面的代码是删除数据的方法:是可以正常实现删除功能的。(数据库是ACCESS)<%
if session("username")="" then
%>
<script language="javascript">
top.location.href="../login.asp"
</script>
<%
response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<%
id=replace(request("id")," ","")
id=split(id,",")
for i=0 to UBound(id)
sql="delete from sell where bianhao='"&id(i)&"'"
conn.execute(sql)
next
response.redirect "sell.asp?page="&request("page")&"&paixu="&request("paixu")&"&paixu2="&request("paixu2")&"&paixu3="&request("paixu3")&"&keyword="&request("keyword")&"&startdate="&request("startdate")&"&enddate="&request("enddate")
%>
下面的是执行插入数据,但却没有办法实现插入功能。(SQL语句我拉出来在ACCESS中执行是正确的。)
<%
if session("username")="" then
%>
<script language="javascript">
top.location.href="../login.asp"
</script>
<%
response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<%
id=replace(request("id")," ","")
id=split(id,",")
for i=0 to UBound(id)
sql="insert into sell(id_produit,bigclass,smallclass,title,huohao,id_ku,ku,shulian,guige,type,price,price2,id_huiyuan,photo,bianhao,beizhu,caizhi,chandi,dingzhi,beihuo)
select
produit.id,bigclass.bigclass,smallclass.smallclass,orderdan.title,orderdan.huohao,orderdan.id_ku,ku.ku,orderdan.shulian,orderdan.guige,'3' as type,orderdan.price,orderdan.price2,huiyuan.id,orderdan.photo,orderdan.bianhao,orderdan.beizhu,orderdan.caizhi,orderdan.chandi,orderdan.dingzhi,orderdan.beihuo
from (((((orderdan inner join produit on orderdan.huohao=produit.huohao)
inner join bigclass on orderdan.id_bigclass=bigclass.id)
inner join smallclass on orderdan.id_smallclass=smallclass.id)
inner join ku on orderdan.id_ku=ku.id )
inner join huiyuan on orderdan.guke=huiyuan.card)
where orderdan.bianhao='"&id(i)&"'"
conn.execute(sql)
next
response.redirect "dingdan_sell.asp?page="&request("page")&"&paixu="&request("paixu")&"&paixu2="&request("paixu2")&"&paixu3="&request("paixu3")&"&keyword="&request("keyword")&"&startdate="&request("startdate")&"&enddate="&request("enddate")
%>