<%
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
%>
<%
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>"
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>"
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
<%
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
%>
这样试试