详细解释下这段代码set rs=conn.execute (sql)。。。。。。。。
setrs=conn.execute(sql)setcid=rs(0)setprod_class_name=rs(1)dowhilenotrs.eofresponse.w...
set rs=conn.execute (sql)
set cid=rs(0)
set prod_class_name=rs(1)
do while not rs.eof
response.write "<option value="&cid&">"&prod_class_name&"</option>"
rs.movenext
loop
rs.close
set rs=nothing
response.write " </select>"&_ 展开
set cid=rs(0)
set prod_class_name=rs(1)
do while not rs.eof
response.write "<option value="&cid&">"&prod_class_name&"</option>"
rs.movenext
loop
rs.close
set rs=nothing
response.write " </select>"&_ 展开
1个回答
展开全部
查询数据库后根据返回的记录集生成下拉列表项。
set rs=conn.execute (sql)‘执行sql
set cid=rs(0)'将第一个字段的值赋给cid
set prod_class_name=rs(1)'将第二个字段的值赋prod_class_name
do while not rs.eof'循环记录集
response.write "<option value="&cid&">"&prod_class_name&"</option>"'生成列表项
rs.movenext'下一条记录
loop'循环
rs.close'关闭记录集
set rs=nothing'注销rs对象
response.write " </select>"&_'生成select
set rs=conn.execute (sql)‘执行sql
set cid=rs(0)'将第一个字段的值赋给cid
set prod_class_name=rs(1)'将第二个字段的值赋prod_class_name
do while not rs.eof'循环记录集
response.write "<option value="&cid&">"&prod_class_name&"</option>"'生成列表项
rs.movenext'下一条记录
loop'循环
rs.close'关闭记录集
set rs=nothing'注销rs对象
response.write " </select>"&_'生成select
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询