| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 369 人关注过本帖
标题:[求助]为什么删除不了???
只看楼主 加入收藏
favoriteran
Rank: 1
等 级:新手上路
帖 子:142
专家分:0
注 册:2006-3-10
收藏
 问题点数:0 回复次数:2 
[求助]为什么删除不了???

请那位大侠帮看看,为什么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
%>

搜索更多相关主题的帖子: 删除 
2006-03-22 09:37
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
sql1="delete from solution where solutionid="&cint(trim(request("id")))
conn.execute sql

用不着rs
2006-03-22 09:56
favoriteran
Rank: 1
等 级:新手上路
帖 子:142
专家分:0
注 册:2006-3-10
收藏
得分:0 
您好,还是不行.....提示 Microsoft VBScript 运行时错误 (0x800A000D)
/bysearch.asp, 第 28 行



海納百川,一切從源開始........
2006-03-22 10:29
快速回复:[求助]为什么删除不了???
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011961 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved