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

我的代码写在下面::
搜索更多相关主题的帖子: 代码 删除 
2006-03-25 09:08
favoriteran
Rank: 1
等 级:新手上路
帖 子:142
专家分:0
注 册:2006-3-10
收藏
得分:0 

<%@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编辑过]


海納百川,一切從源開始........
2006-03-25 09:13
favoriteran
Rank: 1
等 级:新手上路
帖 子:142
专家分:0
注 册:2006-3-10
收藏
得分:0 
拜托了,怎么没人帮我看看啊?我真的急啊.....整个系统都做完了,就差这点了,我老大今天又问我,害得我要加班...找了好久没找出哪有错,求大侠们帮帮忙啊!指点一下小弟

海納百川,一切從源開始........
2006-03-25 09:30
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 
没有错误提示吗?

专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2006-03-25 09:31
无根泉
Rank: 2
等 级:新手上路
威 望:4
帖 子:853
专家分:0
注 册:2004-11-4
收藏
得分:0 
sql1="delete from solution where solution.solutionid="&cint(trim(request("id")))&""
我想应该是这里的错吧,
改成这样试试: sql1="delete from solution where solutionid="&cint(trim(request("id")))


sql="delete 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")))

我很菜,但我很努力!
2006-03-25 09:42
favoriteran
Rank: 1
等 级:新手上路
帖 子:142
专家分:0
注 册:2006-3-10
收藏
得分:0 
我这是从另外一页接受参数过来实现查询后再删除一条我不想要的记录,可是每次一点删除就出错了 ,请问是不是不可以这样去实现啊?
错误提示:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
/bysearch.asp, 第 34 行

海納百川,一切從源開始........
2006-03-25 10:22
water123456
Rank: 5Rank: 5
等 级:贵宾
威 望:15
帖 子:3208
专家分:5
注 册:2006-2-21
收藏
得分:0 
我感觉你应该测试一下,你要删除的数据(也就是你相对应的数据,是不是你要删除的).

让我们风风火火的过一生,别平平淡淡过一年。
2006-03-25 12:26
快速回复:[求助]为什么我的代码实现不了删除?急啊.....
数据加载中...
 
   



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

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