set subrs = conn.execute(subsql) '列出一切资料为temp的记录 if subrs.eof or subrs.bof then response.write ("<option>-----</option>") '如果没有记录,则在这个列表中显示"-----" else while not(subrs.eof or subrs.bof)'否则就用循环列出一切符合条件的记录。 response.write ("<option value=" & subrs(0) & ">" & subrs(0) & "</option>") subrs.movenext wend end if end if
'关闭所有的记录集 subrs.close set subrs = nothing rs.close set rs = nothing conn.close set conn = nothing %> </select>