| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1900 人关注过本帖
标题:修改记录提交后,数据表中的值没有变化
只看楼主 加入收藏
bmydna
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2006-6-1
结帖率:80%
收藏
已结贴  问题点数:10 回复次数:6 
修改记录提交后,数据表中的值没有变化
我在编写一个修改记录的一个页面,在修改页面中,我对数据进行了修改并提交,提示修改成功,但在浏览页面中记录却没有变化。我查找了很多资料,也没有修改成功。请各位高手帮忙看一下以下代码,哪里出错了。
<%if request("action")="modif" then%>

<form name="form2" action=tbwjbrow.asp?action=edit method=POST>
        <input type="hidden" name="gz" value="">

<div align="center">
<table border="0" width="776" cellspacing="1" bgcolor="#9AC1F8" class="border">
    <tr class="tdbg" >
        <td height="20" colspan="3" style="background-image: url('images/admintoptdbg.gif')">
        <p align="center"><b><font size="3">投标文件资料修改</font></b></td>
    </tr>
    <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
      <td height="30" colspan="3" align="left" ><span class="style7"> 当前信息录入提示:由<%=session("admin_dwmc")%>的<%=session("admin_name")%>于<%=date()%>&nbsp;<%=time()%>录入本条信息,其当前IP为: <%=userip1%></span></td>
    </tr>
   
    <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
      <td height="30" align="right" nowrap >序号ID:</td>
      <td height="30" nowrap align="left" colspan="2" >
        <font size="3">
        <%=request("id")%> </font></td>
    </tr>
   
    <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
      <td height="30" align="right" nowrap ><font size="3">工程类别:</font></td>
      <td height="30" nowrap align="left" colspan="2" >
        <font size="2">
        <input type="text" name="gclb" size="29" style="font-size: 12pt" value="<%=request("gclb")%>"></font></td>
    </tr>
   
    <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
      <td height="30" align="right" nowrap ><font size="3">资料名称:</font></td>
      <td height="30" nowrap align="left" colspan="2" >
        <font size="2">
        <input type="text" name="zlmc" size="71" style="font-size: 12pt" value="<%=request("zlmc")%>"></font></td>
    </tr>
    <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
        <td width="122" height="30" align="right" nowrap ><font size="3">关键词:</font></td>
        <TD height="30" nowrap width="645" colspan="2" align="left">
        <font size="2">
        <input type="text" name="gjc" size="71" style="font-size: 12pt" value="<%=request("gjc")%>"></font></TD>
    </tr>
    <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
      <td height="30" align="left" nowrap colspan="2" >
        <p align="right"><font size="3">时间:</font></td>
      <td height="30" align="right" nowrap >
        <p align="left"><font size="2">
        <input type="text" name="sj" size="11" style="font-size: 12pt" value="<%=request("sj")%>"></font><font size="3">
        年</font></td>
    </tr>
   
   
    <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
      <td height="30" align="left" nowrap colspan="2" >
        <p align="right"><font size="3">主要内容:</font></td>
      <td width="463" height="30" align="right" nowrap >
        <p align="left"><textarea rows="28" name="zynr" cols="115"><%=request("zynr")%></textarea></td>
    </tr>
   
    <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
        <td height="48" colspan="3" >
          <p align="center">
            <input type=submit value="修   改" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=reset value="重   写" >
      </td>
    </tr>
   
        
    </table>
      </td>
    </tr>
  </table>
</div>
</form>

<%end if%>


<%if request("action")="edit" then%>
<%
dim gclb,zlmc,gjc,zynr,sj,rs2,sql2
gclb=trim(request("gclb"))
zlmc=trim(request("zlmc"))
gjc=trim(request("gjc"))
zynr=trim(request("zynr"))
sj=trim(request("sj"))

set rs2=server.CreateObject("adodb.recordset")
sql2="select * from tbwjk where id="&request("id")&" "
 rs2.open sql2,conn,1,3
 'rs2.update
 rs2("gclb")=gclb
 rs2("zlmc")=zlmc
 rs2("gjc")=gjc
 rs2("zynr")=zynr
 rs2("sj")=sj
 rs2.update
  response.write"<script>alert('投标文件资料信息修改成功');this.location.href='tbwjbrow.asp?action=fine';</SCRIPT>"
  response.end
   rs2.close
  set rs2=nothing
  %>
  <%end if%>
搜索更多相关主题的帖子: border action request 记录 
2013-05-27 10:35
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11759
专家分:43407
注 册:2006-5-13
收藏
得分:4 
在本地测试过了么?

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2013-05-27 20:22
bmydna
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2006-6-1
收藏
得分:0 
回复 2楼 hu9jj
测试过了,还是不行,不知是哪里出了问题。
2013-05-28 09:15
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:4 
表单中应添加一个隐藏域name="id",对应数据表的id,或者在表单action中传递

----我怎能在别人的苦难面前转过脸去----
2013-05-28 14:55
w8980637
Rank: 2
等 级:论坛游民
帖 子:4
专家分:12
注 册:2013-5-31
收藏
得分:4 
把你传的值用response输出看看,到底接受到没有。还是说传错了
2013-05-31 21:32
maprincesse
Rank: 2
等 级:论坛游民
威 望:1
帖 子:22
专家分:19
注 册:2013-1-15
收藏
得分:0 
sql2="select * from tbwjk where id="&request("id")&" "可以把后面的&" "去掉
另可以在接受数据的表单中把接受的数据response.write出来,看看接受没有
还不行试试把rs2改成200试试sql200 等
2013-06-09 15:57
zouxuechang
Rank: 2
等 级:论坛游民
帖 子:11
专家分:17
注 册:2013-6-20
收藏
得分:0 
应该先根据id找到那条记录,再进行修改。。。
2013-06-20 17:05
快速回复:修改记录提交后,数据表中的值没有变化
数据加载中...
 
   



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

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