请那位大侠帮看看,为什么del时删除不了记录,出错呢?
<body>
<br>
<table width="80%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" height="32">
<tr>
<td width="65">itemname</td>
<td width="143">product</td>
<td width="348">reason</td>
<td width="49">edit</td>
</tr>
<% dim rs,sql
i=0
item=trim(request("item"))
page=request("page")
if page<1 then page=1
page=int(page)
sql="select item.*,product.*,solution.*,reason.* from item,product,solution,reason where item.productid=product.productid and item.itemid=solution.itemid and item.productid=solution.productid and reason.reasonid=solution.reasonid and solution.productid="&cint(trim(request("ChannelId2")))&""
set rs=server.CreateObject("adodb.recordset")
if item<>"" then
sql=sql&" and item.itemid="&cint(item)&""
end if
sql=sql&" order by item.itemid desc"
rs.open sql,conn,3,3
if rs.eof then
response.Write("no record")
else
pagesize=1000
rs.pagesize=pagesize
rs.absolutepage=page
do while not rs.eof and i<pagesize
%>
<form name="editpro" action="bysearch.asp?action=edit&id=<%=rs("itemid")%>" method="post">
<tr>
<td width="65"><%=trim(rs("itemname"))%></td>
<td width="143"><%=rs("productname")%></td>
<td width="348"><%=trim(rs("reason"))%></td>
<td width="49"><input name="button" type="button" onClick="if(window.confirm('Do you really want the deletion?'))location.href='bysearch.asp?action=del&id=<%=rs("solutionid")%>'" value="del"></td>
</tr></form>
<%
rs.movenext
i=i+1
loop
end if%>
</table>
<br>
<center>
<a href="javascript:history.back()">back</a></center>
</body>
</html>
<%
if request("action")="del" then
dim rs1,sql1
sql1="delete from solution where solutionid="&cint(trim(request("id")))&""
set rs1=server.CreateObject("adodb.recordset")
rs1.open sql1,conn,3,3
set re1=nothing
response.Redirect("addsolution.asp")
end if
%>