| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1391 人关注过本帖, 1 人收藏
标题:麻烦帮我看一下这代码错在那里?
只看楼主 加入收藏
sydpoechang
Rank: 1
等 级:新手上路
帖 子:115
专家分:0
注 册:2007-8-22
收藏(1)
 问题点数:0 回复次数:14 
麻烦帮我看一下这代码错在那里?
<form id="form1" name="form1" method="post" action="123.asp?ss=sfqx">
  <input type="submit" name="Submit" value="提交" />
</form>
<!--#include file="Conn1.asp" -->
<%
If Request.QueryString("ss")="sfqx" Then
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from JaAdmin where Userweb='公司注册'",conn1,1,3
if not rs1.eof then
do while not rs1.eof
rs1("qyclass")=3
rs1.movenext
loop
Response.Write "<script language=javascript>alert('修改成功!');window.document.location.href='123.asp';</script>"
else
end if
rs1.update
rs1.close
set rs1=nothing
end if
%>
能实现所有‘公司注册'的qyclass值得为3 但是~不能返回到123.asp
搜索更多相关主题的帖子: 代码 麻烦 
2008-03-29 10:41
sydpoechang
Rank: 1
等 级:新手上路
帖 子:115
专家分:0
注 册:2007-8-22
收藏
得分:0 
ddddddddddd
2008-04-03 09:12
jamesxiaoyao
Rank: 1
等 级:新手上路
威 望:2
帖 子:173
专家分:0
注 册:2007-5-21
收藏
得分:0 
错误提示是什么
2008-04-03 09:16
jamesxiaoyao
Rank: 1
等 级:新手上路
威 望:2
帖 子:173
专家分:0
注 册:2007-5-21
收藏
得分:0 
你这张页面是修改页面 ?
2008-04-03 09:18
jamesxiaoyao
Rank: 1
等 级:新手上路
威 望:2
帖 子:173
专家分:0
注 册:2007-5-21
收藏
得分:0 
那就  
response.Redirect(123.asp )
2008-04-03 09:24
sydpoechang
Rank: 1
等 级:新手上路
帖 子:115
专家分:0
注 册:2007-8-22
收藏
得分:0 
呵呵 自己写的一个程序修改数据库因为现在不管是个人还是公司的值都是0 我想把 公司的qyclass这个值改成3,一个一个去改麻烦

提示

BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/cqsq123/123.asp, 第 14 行
2008-04-03 11:33
sydpoechang
Rank: 1
等 级:新手上路
帖 子:115
专家分:0
注 册:2007-8-22
收藏
得分:0 
<!--#include file="Conn1.asp" -->
<form id="form1" name="form1" method="post" action="123.asp?ss=sfqx">
  <input type="submit" name="Submit" value="提交" />
</form>
<%
If Request.QueryString("ss")="sfqx" Then
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from JaAdmin where Userweb='公司注册'",conn1,1,3
if not rs1.eof then
do while not rs1.eof
rs1("qyclass")=3
rs1.movenext
loop
rs1.update
rs1.close
set rs1=nothing
Response.Write "<script language=javascript>alert('修改成功!');window.document.location.href='123.asp';</script>"
end if
else
end if
%>

rs1.update是现在的14行
2008-04-03 11:34
天涯听雨
Rank: 2
来 自:东莞
等 级:论坛游民
威 望:4
帖 子:497
专家分:64
注 册:2007-8-25
收藏
得分:0 
<form id="form1" name="form1" method="post" action="123.asp?ss=sfqx">
  <input type="submit" name="Submit" value="提交" />
</form>
<!--#include file="Conn1.asp" -->
<%
If Request.QueryString("ss")="sfqx" Then
   set rs1=server.CreateObject("adodb.recordset")
   rs1.open "select * from JaAdmin where Userweb='公司注册'",conn1,1,3

   if not rs1.eof then
     do while not rs1.eof
        rs1("qyclass")=3
        rs1.movenext
    loop
    Response.Write "<script language=javascript>alert('修改成功!');window.document.location.href='123.asp';</script>"
  else

  end if
  rs1.update
  rs1.close
  set rs1=nothing
end if
%>

改成:

<form id="form1" name="form1" method="post" action="123.asp?ss=sfqx">
  <input type="submit" name="Submit" value="提交" />
</form>
<!--#include file="Conn1.asp" -->
<%
If Request.QueryString("ss")="sfqx" Then
   set rs1=server.CreateObject("adodb.recordset")
   rs1.open "select * from JaAdmin where Userweb='公司注册'",conn1,1,3


  rs1("qyclass")=3    '请确定 qyclass 字段是数字类型字段

  rs1.update

  set rs1=nothing

  Response.Write "<script language=javascript>alert('修改成功!');window.location.href='123.asp';</script>"
end if
%>

从明天起做幸福的人,喂马劈柴周游世界!
2008-04-03 12:45
sydpoechang
Rank: 1
等 级:新手上路
帖 子:115
专家分:0
注 册:2007-8-22
收藏
得分:0 
天涯你这样只能修改一个
2008-04-05 09:16
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
if not rs1.eof then
     do while not rs1.eof
        rs1("qyclass")=3
        rs1.movenext
    loop
改成
if not (rs1.eof and rs1.bof)then
     do while not rs1.eof
        rs1("qyclass")=3
        rs1.movenext
    loop
试试这样
2008-04-05 12:56
快速回复:麻烦帮我看一下这代码错在那里?
数据加载中...
 
   



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

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