假如有如下程序段,其中'2'在表中是表示月份'如有以下想法,该如何编写程序段?可以实现吗?高手帮忙看看,谢谢!目的:以下程序段中的'2'改为由用户选择输入,即当运行含有以下程序段的页面时,弹出一对话框
让用户选择输入月份,使得2可以变3、4等等,使得以下程序段中的'2'可以变成3、4等。
<%
set rs=conn.execute("select * from 1 where time='留级' and a28='已归档'and a18='2'")
do while not rs.eof
shl_xss=shl_xss+1
rs.movenext
loop
rs.close
set rs=conn.execute("select * from 1 where user like '%初%' and adress11='2'")
do while not rs.eof
shl_msj=shl_msj+1
rs.movenext
loop
rs.close
set rs=conn.execute("select * from 1 where xueli='三好' and adress11='2'")
do while not rs.eof
shl_zjs=shl_zjs+1
rs.movenext
loop
rs.closeset rs=conn.execute("select * from 1 where xueli='优秀' and adress11='2'")
do while not rs.eof
shl_fssc=shl_fssc+1
rs.movenext
loop
rs.close
%>

解决方案 »

  1.   

    建议你去弄清B/S的概念再说吧.
    类似的要求不是不能实现,是完全没有意久,得多加N次页面跳转和判断.
      

  2.   

    先定义一个全局变量,在用户选择年份的时候,把他选好的月份负值给全局变量,然后在sql语句中使用,举个例子:set rs=conn.execute("select * from 1 where xueli='优秀' and adress11='" & session("month") & "'")
    当然,这个是vb语法,需要在脚本那里写明。
      

  3.   

    分两个页面,一个输入,一个显示。在后一个页面把你的'2'改成request变量。
    如果现在一个页面里实现,看看异步HTTP吧(参考,Ajax)