法制编辑部之三年之痒:关于下拉列表添加判断条件的代码(特急!!)

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/27 20:56:33
代码如下
set rs0 = server.createobject("adodb.recordset")
sql = "select * from country"
rs0.open sql,conn,1,1
do while not rs0.eof
strOptionList = strOptionList &"<option value="""&rs0("CountryID")&""">"&rs0("Description")&"</option>"
rs0.movenext
loop
response.write "<select name=""Country""><option value="""">请选择</option>" & strOptionList & "</select>"
strOptionList = ""
rs0.close
set rs0 = nothing
%>

问题是在strOptionList里面的各个选项,如果Country有值,需要带出来,请高手指点!

strOptionList = strOptionList &"<option value="""&rs0("CountryID")&""">"&rs0("Description")&"</option>"

补充,在这里面加一个判断条件就可以,但是代码怎么写都会出错!

错误提示是什么?