麻烦大家帮忙看下 asp 修改数据 没有任何提示也修改不了

donghyu 2009-09-18 09:36:47


<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<%
if Request.QueryString("mark")="southidc" then

Opdate=Trim(Request("Opdate"))
Nu=Trim(Request("Nu"))
First=Trim(Request("First"))
SSecond=Trim(Request("Second"))
Third=Trim(Request("Third"))
Fourth=Trim(Request("Fourth"))
Fifth=Trim(Request("Fifth"))
Sixth=Trim(Request("Sixth"))
Seventh=Trim(Request("Seventh"))
Spe=Trim(Request("Spe"))
Content=Trim(Request("Content"))

Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from Shuangse where id="&id
rs.open sql,conn,1,3
rs("Opdate")=Opdate
rs("Nu")=Nu
rs("First")=First
rs("Second")=SSecond
rs("Third")=Third
rs("Fourth")=Fourth
rs("Fifth")=Fifth
rs("Sixth")=Sixth
rs("Seventh")=Seventh
rs("Spe")=Spe
rs("Content")=Content
rs.update
rs.close
response.redirect "Admin_Shuangse.asp"
end if
%>
<%
id=request.querystring("id")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From Shuangse where id="&id, conn,1,1
%>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"> <br>
<table width="660" border="0" cellpadding="0" cellspacing="1" class="table_southidc">
<tr>
<td class="back_southidc" height="25"> <div align="center"><strong>修改双色球开奖信息<br></strong></div></td>
</tr>
<tr>
<form method="post" name="myform" action="Admin_ShuangseEdit.asp?mark=southidc">
<input type=hidden name=id value=<%=id%>>
<td><div align="center">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr bgcolor="#fcfcfc">
<td width="27%" height="25"><div align="center">开奖日期</div></td>
<td width="73%">
<input name="Year" type="text" value="<%=rs("Opdate")%>" size="15" maxlength="30">
</td>
</tr>
<tr bgcolor="#fcfcfc">
<td height="25"><div align="center">奖期</div></td>
<td>第<input name="Nu" type="text" value="<%=rs("Nu")%>" size="10" maxlength="30">期</td>
</tr>
<tr bgcolor="#fcfcfc">
<td height="25"><div align="center">红球号码</div></td>
<td> 
<input name="First" type="text" value="<%=rs("First")%>" size="2" maxlength="2"> 
<input name="Second" type="text" value="<%=rs("Second")%>" size="2" maxlength="2"> 
<input name="Third" type="text" value="<%=rs("Third")%>" size="2" maxlength="2"> 
<input name="Fourth" type="text" value="<%=rs("Fourth")%>" size="2" maxlength="2"> 
<input name="Fifth" type="text" value="<%=rs("Fifth")%>" size="2" maxlength="2"> 
<input name="Sixth" type="text" value="<%=rs("Sixth")%>" size="2" maxlength="2"> 
</td>
</tr>
<tr bgcolor="#fcfcfc">
<td height="25"><div align="center">蓝球号码</div></td>
<td>  <input name="Spe" type="text" value="<%=rs("Spe")%>" size="2" maxlength="2"></td>
</tr>
<tr bgcolor="#FCFCFC">
<td height="25" valign="top"><div align="center">开奖公告</div></td>
<td valign="top"> <textarea name="Content" style="display:none"><%=rs("Content")%></textarea>
<iframe ID="eWebEditor1" src="SouthidcEditor/ewebeditor.asp?id=content&style=southidc" frameborder="0" scrolling="no" width="550" HEIGHT="300"></iframe>
</td>
</tr>
<tr bgcolor="#FCFCFC">
<td height="25" colspan="2">
<input type=hidden name=Pic value=<%=rs("Pic")%>>
<div align="center">
<input name="submit" type="submit" value="确定">
 
<input name="reset" type="reset" value="恢复">
</div></td>
</tr>
</table>
</div></td>
</form>
</tr>
</table></td>
</tr>
</table>
<!-- #include file="Inc/Foot.asp" -->







这段代码 修改数据 点提交后没有任何反应,就跟刷新一样,麻烦大家帮忙看下,是哪里出错啦。

拜托啦!~1
...全文
107 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
babycry627 2009-09-18
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 hookee 的回复:]
少一句 id = Trim(Request("id")) 吧

[/Quote]
是少了一个接收ID的值啊
所以那个数据库记录没有执行
你用的这个 response.redirect "Admin_Shuangse.asp" 执行了
这样就感觉刷新了一下
homel 2009-09-18
  • 打赏
  • 举报
回复
输出你的sql语句看看参数有没有传递过去

sql="select * from Shuangse where id="&id
在他后面写上response.write sql
hookee 2009-09-18
  • 打赏
  • 举报
回复
少一句 id = Trim(Request("id")) 吧
bo3235 2009-09-18
  • 打赏
  • 举报
回复
看错下面了,不好意思 ,收回最后一个注释
bo3235 2009-09-18
  • 打赏
  • 举报
回复
修改下布局
<% 
id=request.querystring("id")
'改到这里即可,
if Request.QueryString("mark")="southidc" then
'需要防止SQL注入风险,需要过滤
Opdate=Trim(Request("Opdate"))
Nu=Trim(Request("Nu"))
First=Trim(Request("First"))
SSecond=Trim(Request("Second"))
Third=Trim(Request("Third"))
Fourth=Trim(Request("Fourth"))
Fifth=Trim(Request("Fifth"))
Sixth=Trim(Request("Sixth"))
Seventh=Trim(Request("Seventh"))
Spe=Trim(Request("Spe"))
Content=Trim(Request("Content"))

Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from Shuangse where id="&id '原来的参数肯定不在
rs.open sql,conn,1,3
rs("Opdate")=Opdate
rs("Nu")=Nu
rs("First")=First
rs("Second")=SSecond
rs("Third")=Third
rs("Fourth")=Fourth
rs("Fifth")=Fifth
rs("Sixth")=Sixth
rs("Seventh")=Seventh
rs("Spe")=Spe
rs("Content")=Content
rs.update
rs.close
response.redirect "Admin_Shuangse.asp"
end if
%>
<%
'说实话,这里的先更新数据库,然后再查询出来,不觉得效率有问题吗?有时间多看看想想可以提高很多的
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From Shuangse where id="&id, conn,1,1
%>

<!-- 提交时候也需要把编号提交过去,否则你依据什么来修改你的数据库-->

<form method="post" name="myform" action="Admin_ShuangseEdit.asp?id= <%=id%>&mark=southidc">
bo3235 2009-09-18
  • 打赏
  • 举报
回复
[code=VBScript]<%
id=request.querystring("id")
'改到这里即可,
if Request.QueryString("mark")="southidc" then
'需要防止SQL注入风险,需要过滤
Opdate=Trim(Request("Opdate"))
Nu=Trim(Request("Nu"))
First=Trim(Request("First"))
SSecond=Trim(Request("Second"))
Third=Trim(Request("Third"))
Fourth=Trim(Request("Fourth"))
Fifth=Trim(Request("Fifth"))
Sixth=Trim(Request("Sixth"))
Seventh=Trim(Request("Seventh"))
Spe=Trim(Request("Spe"))
Content=Trim(Request("Content"))

Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from Shuangse where id="&id '原来的参数肯定不在
rs.open sql,conn,1,3
rs("Opdate")=Opdate
rs("Nu")=Nu
rs("First")=First
rs("Second")=SSecond
rs("Third")=Third
rs("Fourth")=Fourth
rs("Fifth")=Fifth
rs("Sixth")=Sixth
rs("Seventh")=Seventh
rs("Spe")=Spe
rs("Content")=Content
rs.update
rs.close
response.redirect "Admin_Shuangse.asp"
end if
%>
<%
'说实话,这里的先更新数据库,然后再查询出来,不觉得效率有问题吗?有时间多看看想想可以提高很多的
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From Shuangse where id="&id, conn,1,1
%>

<!-- 提交时候也需要把编号提交过去,否则你依据什么来修改你的数据库-->

<form method="post" name="myform" action="Admin_ShuangseEdit.asp?id=<%=id%>&mark=southidc">

[code]

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧