注册 登录
编程论坛 ASP技术论坛

菜鸟请教以下代码什么意思?为什么要这样?

wxm198427 发布于 2008-07-10 20:57, 682 次点击
<%
                if Request.QueryString("keyno")<>"" then
                
                sql="select title from miscell where keyno="+keyno
                set rss=server.createobject("adodb.recordset")
                 rss.Open sql,cn,1,1
                 if not rss.eof and not rss.bof then
                do while not rss.eof
                
                response.Write("&nbsp;&gt;&gt;&nbsp;"+rss(0))
                rss.movenext
                loop
                end if
                rss.close
                set rss=nothing
                end if                
                %>
3 回复
#2
孤独冷雨2008-07-11 09:49
if Request.QueryString("keyno")<>"" then '通过GET传递过来一个参数:KEYNO;并判断其是否为空;如果不是空就往下执行!
               
                sql="select title from miscell where keyno="+keyno '在表miscell中查询符合KEYNO所含值的数据!
                set rss=server.createobject("adodb.recordset")
                 rss.Open sql,cn,1,1
                 if not rss.eof and not rss.bof then '如果存在,把其循环输出!
                do while not rss.eof  
               
                response.Write(" &gt;&gt; "+rss(0))
                rss.movenext
                loop
                end if
                rss.close
                set rss=nothing
                end if               
                %>
#3
wxm1984272008-10-14 17:01
xiexie!!!!
#4
anlige2008-10-14 19:17
基本的数据库条件查询...呵呵
1