我的代码写在下面::
<%@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
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="&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=100
rs.pagesize=pagesize
rs.absolutepage=page
do while not rs.eof and i<pagesize
%>
<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>
<%
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 sql1
sql1="delete from solution where solution.solutionid="&trim(request("id"))&""
conn.execute sql1
set re1=nothing
response.Redirect("bysearch.asp")
end if
%>
[此贴子已经被作者于2006-3-25 10:23:38编辑过]