找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 497|回复: 9

请问循环问题

[复制链接]
发表于 2010-1-7 05:30:03 | 显示全部楼层 |阅读模式 IP:江苏扬州
<%
opendatabase()
sql="select count(*) from cs_item_xq where tg='未通过'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn
if rs(0)<>0 then
Response.write"<script>alert('退件\n这里我想是数据库循环出来的在这里怎么写谢谢');if(window.confirm('是否进入退件页面') == true){window.location = 'report_forms/sftg.asp';}</script>"
end if
%>
发表于 2010-1-7 05:30:05 | 显示全部楼层 IP:江苏扬州
说实话,我没看懂楼主说的什么意思..
回复

使用道具 举报

发表于 2010-1-7 05:30:13 | 显示全部楼层 IP:江苏扬州
顶上去 怎么没人帮我啊
回复

使用道具 举报

发表于 2010-1-7 05:30:16 | 显示全部楼层 IP:江苏扬州
<%
opendatabase()
sql="select count(*) from cs_item_xq where tg='未通过'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn
if rs(0)<>0 then
Response.write"<script>alert('退件\"&rs(0)&"');if(window.confirm('是否进入退件页面') == true){window.location = 'report_forms/sftg.asp';}</script>"
end if
%>
其实我是要的这种
可是 alert('退件\"&rs(0)&"'); 这里只能读出一条数据 要是加个循环
DO WHLIE NOT RS.EOF
AA=RS(0)
RS.MOVENEXT
LOOP
Response.write"<script>alert('退件\"&AA)&"');if(window.confirm('是否进入退件页面') == true){window.location = 'report_forms/sftg.asp';}</script>"

就会出错 请帮忙啊
回复

使用道具 举报

发表于 2010-1-7 05:30:19 | 显示全部楼层 IP:江苏扬州
DO while NOT RS.EOF
AA=RS(0)
Response.write"<script>alert('退件\"&AA)&"');if(window.confirm('是否进入退件页面') == true){window.location = 'report_forms/sftg.asp';}</script>"
RS.MOVENEXT
LOOP

这样循环不对的 因为把这个ALERT 也循环出来了
所以必须把
DO while NOT RS.EOF
AA=RS(0)
RS.MOVENEXT
LOOP
Response.write"<script>alert('退件\"&AA)&"');if(window.confirm('是否进入退件页面') == true){window.location = 'report_forms/sftg.asp';}</script>"

但是呢ALET提示的根本不是循环出来的AA 而是最后一条怎么解决啊
回复

使用道具 举报

发表于 2010-1-7 05:30:22 | 显示全部楼层 IP:江苏扬州
感觉楼主的意思是循环一次,检查一下是否是退件的问题,是这个意思吗?
试试把alert 放到循环中行不行
回复

使用道具 举报

发表于 2010-1-7 05:30:25 | 显示全部楼层 IP:江苏扬州
DO while NOT RS.EOF
AA=RS(0)
Response.write"<script>alert('退件\"&AA)&"');if(window.confirm('是否进入退件页面') == true){window.location = 'report_forms/sftg.asp';}</script>"
RS.MOVENEXT
LOOP

还是不行 alert('退件\"&AA)&"') 这里根本都没循环出来
只是读取了最后一位
回复

使用道具 举报

发表于 2010-1-7 05:30:28 | 显示全部楼层 IP:江苏扬州
其实我是要的这种
可是 alert('退件\"&rs(0)&"'); 这里只能读出一条数据 要是加个循环
DO WHLIE NOT RS.EOF
AA=RS(0)
Response.write"<script>alert('退件\"&AA)&"');if(window.confirm('是否进入退件页面') == true){window.location = 'report_forms/sftg.asp';}</script>"

RS.MOVENEXT
LOOP
这样不知道行不行,或者定义个变量来放AA
回复

使用道具 举报

发表于 2010-1-7 05:30:31 | 显示全部楼层 IP:江苏扬州
  1. <%
  2. opendatabase()
  3. sql="select count(*) from cs_item_xq where tg='未通过'"
  4. set rs=server.createobject("adodb.recordset")
  5. rs.open sql,conn
  6. if rs(0)<>0 then
  7. Response.write"<script>alert('退件\n"
  8. rs.close
  9. sql="select title from cs_item_xq where tg='未通过'"
  10. do while not rs.eof
  11. response.write rs(0)&"\n"
  12. rs.movenext
  13. loop
  14. rs.close
  15. Response.write""');if(window.confirm('是否进入退件页面') == true){window.location = 'report_forms/sftg.asp';}</script>"
  16. end if
  17. %>
复制代码
回复

使用道具 举报

发表于 2010-1-7 05:30:37 | 显示全部楼层 IP:江苏扬州
<%
opendatabase()
sql="select count(*) from cs_item_xq where tg='未通过'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn
if rs(0)<>0 then
Response.write"<script>alert('退件\"&rs(0)&"');if(window.confirm('是否进入退件页面') == true){window.location = 'report_forms/sftg.asp';}</script>"
end if
%>
这样试试
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 11:33 , Processed in 0.309516 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表