日期:2014-05-17  浏览次数:20993 次

请教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
%>