| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 941 人关注过本帖
标题:[求助]大侠们帮偶看看问题出在哪里
只看楼主 加入收藏
wwwsensen
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2005-10-31
收藏
 问题点数:0 回复次数:20 
[求助]大侠们帮偶看看问题出在哪里

修改、添加都可以,删除不行,why??

<!--#include file="conn.asp"-->
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%dim action,ztid
ztid=request.QueryString("id")
action=request.QueryString("action")
set rs=server.CreateObject("adodb.recordset")
select case action
'/////修改专题类别
case "ztsave"
rs.open "select * from zhuanti where ztid="&ztid,conn,1,3
rs("ztname")=trim(request("ztname"))
rs("ztorder")=request("ztorder")
rs.update
rs.close
response.write "<script language=javascript>alert('成功修改了专题类别!');history.go(-1);</script>"
response.End
'/////添加专题类别
case "ztadd"
rs.open "select * from zhuanti",conn,1,3
rs.addnew
rs("ztname")=trim(request("ztname"))
rs("ztorder")=request("ztorder")
rs.update
rs.close
response.redirect "zhuanti.asp?action=zt"
response.End
'/////删除专题类别
case "ztdel"
conn.execute "delete from zhuanti where ztid="&ztid
response.redirect "zhuanti.asp?action=zt"
response.End
'/////删除专题类别
end select
set rs=nothing
%>
<table class="tableBorder" width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td align="center" background="../images/admin_bg_1.gif">&nbsp;</td> <td align="center" background="../images/admin_bg_1.gif">&nbsp;</td>
</tr>
<tr>
<td bgcolor="#E8F1FF" colspan="2">
<%select case action
case "zt"%>
<table width="500" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#183789">
<tr bgcolor="#E8F1FF">
<td width="40%" align="center" background="../images/admin_bg_1.gif">
<font color="#FFFFFF">专题类别</font></td>
<td width="20%" align="center" background="../images/admin_bg_1.gif"><font color="#ffffff">排 序</font></td>
<td width="40%" align="center" background="../images/admin_bg_1.gif"><font color="#ffffff">操 作</font></td>
</tr>
<%dim i,j
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from zhuanti order by ztorder",conn,1,1
i=rs.recordcount
do while not rs.eof%>
<tr>
<form name="form1" method="post" action="zhuanti.asp?action=ztsave&id=<%=rs("ztid")%>">
<td bgcolor="#E8F1FF" align="center">
<input name="ztname" type="text" id="ztname" size="14" value=<%=trim(rs("ztname"))%>>
</td>
<td bgcolor="#E8F1FF" align="center">
<input name="ztorder" type="text" id="ztorder" size="2" value=<%=rs("ztorder")%> onKeyPress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))">
</td>
<td bgcolor="#E8F1FF" STYLE='PADDING-LEFT: 20px'>
<input type="submit" name="Submit" value="修 改">
&nbsp;<a href="zhuanti.asp.asp?action=ztdel&id=<%=rs("ztid")%>"><font color="#FF0000">删除</font></a>
</td>
</form>
</tr>
<%rs.movenext
loop
rs.close
set rs=nothing%>
<tr>
<td bgcolor="#E8F1FF" align="center" colspan="3" background="../images/admin_bg_1.gif"><font color="#ffffff">添加</font><font color="#FFFFFF">专题类别</font></td>
</tr>
<tr>
<form name="form2" method="post" action="zhuanti.asp?action=ztadd">
<td bgcolor="#E8F1FF" align="center">
<input name="ztname" type="text" id="ztname" size="14">
</td>
<td bgcolor="#E8F1FF" align="center">
<input name="ztorder" type="text" id="ztorder" value=<%=i+1%> size="2" onKeyPress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))">
</td>
<td bgcolor="#E8F1FF" STYLE='PADDING-LEFT: 20px'>
<input type="submit" name="Submit3" value="添 加">
</td>
</form>
</tr>
</table>
<%case "zhifu"%>
<table width="500" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#183789">
<tr bgcolor="#E8F1FF">
<td width="40%" align="center" background="../images/admin_bg_1.gif"><font color="#ffffff">专题类别</font></td>
<td width="20%" align="center" background="../images/admin_bg_1.gif"><font color="#ffffff">排 序</font></td>
<td width="40%" align="center" background="../images/admin_bg_1.gif"><font color="#ffffff">操 作</font></td>
</tr>
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from zhuanti where fangshi=1 order by ztorder",conn,1,1
j=rs.recordcount
do while not rs.eof%>
<tr>
<form name="form1" method="post" action="zhuanti.asp?action=zhifusave&id=<%=rs("ztid")%>">
<td bgcolor="#E8F1FF" align="center">
<input name="ztname" type="text" id="ztname" size="14" value=<%=trim(rs("ztname"))%>>
</td>
<td bgcolor="#E8F1FF" align="center">
<input name="ztorder" type="text" id="ztorder" size="2" value=<%=rs("ztorder")%> onKeyPress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))">
</td>
<td bgcolor="#E8F1FF" STYLE='PADDING-LEFT: 20px'><input type="submit" name="Submit2" value="确 认">
&nbsp;<a href="zhuanti.asp?action=zhifudel&id=<%=rs("ztid")%>" onClick="return confirm('您确定进行删除操作吗?')"><font color="#FF0000">删除</font></a>
</td>
</form>
<%rs.movenext
loop
rs.close
set rs=nothing%>
</tr>
<tr>
<td bgcolor="#E8F1FF" align="center" colspan="3" background="../images/admin_bg_1.gif"><font color="#ffffff">添加</font><font color="#FFFFFF">专题类别</font></td>
</tr>
<tr>
<form name="form1" method="post" action="zhuanti.asp?action=zhifuadd">
<td bgcolor="#E8F1FF" align="center">
<input name="ztname" type="text" id="ztname" size="14">
</td>
<td bgcolor="#E8F1FF" align="center">
<input name="ztorder" type="text" id="ztorder" value=<%=j+1%> size="2" onKeyPress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))">
</td>
<td bgcolor="#E8F1FF" STYLE='PADDING-LEFT: 20px'>
<input type="submit" name="Submit32" value="添 加">
</td>
</form>
</tr>
</table>
<%end select%>
</td>
</tr>
</table>
<!--#include file="copyright.asp"-->
</body>
</html>
<script>
function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
</script>

搜索更多相关主题的帖子: html content include action title 
2005-11-09 15:31
rainic
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2367
专家分:0
注 册:2005-8-9
收藏
得分:0 
<a href="zhuanti.asp.asp?action=ztdel&id=<%=rs("ztid")%>"><font color="#FF0000">删除</font></a>


<a href="zhuanti.asp?action=zhifudel&id=<%=rs("ztid")%>" onClick="return confirm('您确定进行删除操作吗?')">


你点的是哪个删除

2005-11-09 15:41
wwwsensen
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2005-10-31
收藏
得分:0 

两个都点了,都不行啊


===为了明天更美好我们一起来学习===
2005-11-09 16:07
fcnh1983
Rank: 1
等 级:新手上路
帖 子:665
专家分:0
注 册:2005-8-31
收藏
得分:0 
;<a href="zhuanti.asp?action=zhifudel&id=<%=rs("ztid")%>" onClick="return confirm('您确定进行删除操作吗?')"

肯定不行了写成zhifudel这样能删除吗
判断case "ztdel"的是这样

^^多谢赐教!!无以为报只好以身相许!!!^^谢谢,不用谢,要谢的,多说不用了^^如果真的要谢,那就嫁给我吧,好啊^^
2005-11-09 16:44
303770957
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:小飞侠
威 望:6
帖 子:838
专家分:2125
注 册:2005-9-10
收藏
得分:0 

这个程序是你编的么?


♂ 死后定当长眠,生前何须久睡。♀
2005-11-09 16:47
wwwsensen
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2005-10-31
收藏
得分:0 

改成 ztdel 也还是不行啊


===为了明天更美好我们一起来学习===
2005-11-09 16:49
alonglqw
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2005-11-9
收藏
得分:0 
使用的是什么数据库?
delete from zhuanti where ztid="&ztid

改为

delete zhuanti where ztid="&ztid
2005-11-09 16:51
wwwsensen
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2005-10-31
收藏
得分:0 
还是不行啊,俺

===为了明天更美好我们一起来学习===
2005-11-09 16:55
alonglqw
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2005-11-9
收藏
得分:0 

你爱修改以后,把数据库连接关闭了,下面是不是又没有打开!
你试试把rs.close注释掉!

2005-11-09 17:23
wwwhouhou
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2005-10-27
收藏
得分:0 

还是不行哦

2005-11-10 08:11
快速回复:[求助]大侠们帮偶看看问题出在哪里
数据加载中...
 
   



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

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