当前位置: 代码迷 >> ASP >> 请问ASP读取多行数据怎么引用
  详细解决方案

请问ASP读取多行数据怎么引用

热度:57   发布时间:2012-05-29 12:16:00.0
请教ASP读取多行数据如何引用
在表bb中的字段:
Flagtype `````` FlagName
  2 ``````````` aa
  2 ``````````` bb
  3 ``````````` cc
  3 ``````````` dd
  3 ``````````` ee

ASP代码:
C# code

sql = "select FlagName from bb where FlagType=3"
rs.open sql,conn,1
while not rs.eof
N_FlagID=rs("FlagName")
rs.movenext
wend



想在下拉菜单中引用:
HTML code

<select name=qjtz><option><%=N_FlagID%></option></select>



请教一下SQL及ASP的详细写法,以上写法只能显示一行

------解决方案--------------------
VBScript code

    response.write("<select>")
    sql = "select FlagName from bb where FlagType=3"
    rs.open sql,conn,1
    while not rs.eof
        response.write("<option>"&rs("FlagName")&"</option>")
    rs.movenext
    wend
    response.write("</select>")

------解决方案--------------------

VBScript code
<select name=qjtz>
<%sql = "select FlagName from bb where FlagType=3"
rs.open sql,conn,1
while not rs.eof
%>
<option><%=rs("FlagName")%></option>
<%
rs.movenext
wend
%> 
  相关解决方案