标题:继续求助
只看楼主
syh878
Rank: 1
等 级:新手上路
威 望:2
帖 子:461
专家分:0
注 册:2005-9-2
 问题点数:0 回复次数:4 
继续求助

现在的问题是应该删除的和实际删除的不一样,我把原来执行的那个网页代码贴出来啊 <%@language=VBScript%> <% dim belong1 belong1=CStr(server.htmlencode(request("belong1")))

Set Conn=Server.CreateObject("ADODB.Connection") conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("装备分布.mdb") CommandText="select * from 装备分布 where 所属市局='"&belong1&"'" Set RS=Conn.Execute(CommandText) %>

<html>

<head> <meta name="GENERATOR" content="Microsoft FrontPage 6.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>新建网页 1</title> </head>

<body> <p align="center" style="margin-bottom: 0"><span style="letter-spacing: 2px"><b> 装备分布情况</b></span></p> <table border=0 cellspacing="1" bgcolor="#000080" width="99%"> <% Response.write "<tr>" For I=0 To RS.Fields.Count-1 %>

<td bgcolor="#FFF7E6"><font style="font-size: 9pt"><%=RS(I).Name%></font></td>

<% Next Response.write "<td bgcolor="&"#FFF7E6"&">"&"&nbsp;"&"</td>"&"<td bgcolor="&"#FFF7E6"&">"&"&nbsp;"&"</td>"&"</tr>"

While Not RS.EOF Response.write "<tr>" For I=0 To RS.Fields.Count-1 %> <td bgcolor="#FFFFFF"><font style="font-size: 9pt"><%=RS(I).Value%></font></td> <%

Next %> <td bgcolor="#FFFFFF" width="29"> <p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <a style="font-size:9pt;color:#293876;text-decoration:none" href="modify.asp?key=<%=RS("编号")%>">修改</a><span style="font-size: 9pt"> </span> </td> <td bgcolor="#FFFFFF" width="36"> <p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <a style="font-size:9pt;color:#293876;text-decoration:none" href="delete.asp?key=<%=RS("编号")%>">删除</a><span style="font-size: 9pt"> </span> </td>

<% RS.MoveNext Response.write "</tr>" Wend

RS.Close Conn.Close %> </table> <p align=center> <a style="font-size:9pt;color:#293876" href=add.asp>点击此处添加新纪录</a><span style="font-size: 9pt"> </span> </p> <p align=center> <input type="button" name="Button" value="返回" onclick="history.back();"> </p>

</body>

</html>

2005-09-07 16:13
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
得分:0 
delete.asp?key=&lt;%=RS("编号")%&gt;

delete.asp中至少要有:
id=request("key")
conn.execute "delete from 装备分布 where 编号="&amp;id
2005-09-07 16:49
syh878
Rank: 1
等 级:新手上路
威 望:2
帖 子:461
专家分:0
注 册:2005-9-2
得分:0 

我把delete.asp代码贴出来啊, <% dim key key=Request.QueryString("key")

Set Conn=Server.CreateObject("ADODB.Connection") conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("装备分布.mdb") CommandText="select * from 装备分布 where [编号]=" &key Set RS=Conn.Execute(CommandText) %>

<p align="center"><b><font size="4">装备分布</font></b></p>

<table border=0 cellspacing="1" bgcolor="#808080" width="99%" style="font-size: 9pt; font-family: 宋体"> <% Response.write "<tr>" For I=0 To RS.Fields.Count-1 Response.write "<td bgcolor=#f5f5f5>"& RS(I).Name & "</td>" Next Response.write "</tr>"

While Not RS.EOF Response.write "<tr>" For I=0 To RS.Fields.Count-1 Response.Write "<td bgcolor=#ffffff>" & RS(I).Value & "</td>" Next Response.write "</tr>" RS.MoveNext Wend RS.MoveFirst

%> </table>

<html>

<head> <span style="font-size: 9pt"> <meta http-equiv="Content-Language" content="zh-cn"> <meta name="GENERATOR" content="Microsoft FrontPage 6.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>记录删除</title> </head>

</span>

<body style="text-align: center"> <p align="center"><font color="#FF0000" style="font-size: 9pt">你确定删除此条记录吗?</font></p>

<p align="center"><a href="secdelete.asp?number=<%=RS("装备编号")%>"><span style="font-size: 9pt">确定</span></a><span style="font-size: 9pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="index2.htm"><span style="font-size: 9pt">取消</span></a></p>

<% RS.close conn.close %>

</body>

</html> 帮我看看怎么改


2005-09-07 16:55
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
得分:0 
删除记录还用作这么多文件吗?参数穿来穿去是不是传错了
2005-09-08 07:56
syh878
Rank: 1
等 级:新手上路
威 望:2
帖 子:461
专家分:0
注 册:2005-9-2
得分:0 
谢谢islet

2005-09-08 10:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-26972-1-1.html




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

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