迅腾网络>圈子>建站知识> asp读取access表里一列值放进下拉菜单

asp读取access表里一列值放进下拉菜单

热度:11917 / 2012-9-21 / 廊坊网站建设 / 建站知识

即这样一段代码:读取access里表S里A列的值,将这一列值放进一个下拉菜单里

 

<select name="fl" id="fl">
  <option value="">请选择</option>

<%
sql = "select classname from exam_class order by classorder asc" 'exam_class表名。classname字段名
set drs = conn.execute(sql)'conn是数据库连接
if not drs.eof then
while not drs.eof

response.Write "<option value='"&drs(0)&"'  "&se&">"&drs(0)&"</option>"
drs.movenext
wend
end if
drs.close
set drs = nothing
%></select>