您好,也就是说我查询得出结果后发现有些数据是有错误的或是不要的,我想修改,删除也可以,请问要怎么做?下面是我的代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asp"-->
<!-- #include file="inc/checklogin.asp"-->
<!--#include file="inc/md5.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>searchbyparts</title>
<link href="inc/style.css" rel="stylesheet" type="text/css">
</head>
<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="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
%>
请各位帮帮忙.......