走近科学 水怪 下载:数据库读取下拉菜单修改怎么写

来源:百度文库 编辑:神马品牌网 时间:2024/04/27 20:36:59
这个是我读取下拉菜单
<SELECT name=Gs_QuyuD>
<OPTION>==请选择分类==</OPTION>
<%
Set TypeList1 = conn.Execute("Select * From Quyu_Da Order By Quyu_DSortID")
If Not TypeList1.Eof Then
While Not TypeList1.Eof
Response.Write "<option value="&TypeList1("Quyu_DID")&">"&TypeList1("Quyu_DTitle")&"</option>"
TypeList1.Movenext
Wend
End If
%>
</SELECT>

和修改的
<select name="Gs_QuyuD" id="Gs_QuyuD" >
<option value="">====产品类别====</option>
<%
Set TypeList = conn.Execute("Select * From Quyu_Da Order By Quyu_DSortID")
If Not TypeList.Eof Then
While Not TypeList.Eof
Response.Write "<option value="&TypeList("Quyu_DID")&""
If TypeList("Quyu_DID") =InfoRead("Gs_QuyuD")Then Response.Write " selected"
Response.Write ">"&TypeList("Quyu_DTitle")&"</option>"
TypeList.Movenext
Wend
End If
%>
</select>
上面的读取下拉菜单是正确的

但后面那个修改的时候读取就出错了
显示不正常,

大家怎么指点下啊
怎么写啊

if 错了
还有,问下InfoRead("Gs_QuyuD")也是另一个表吗/
它的movenext,你做了吗呵呵
你的代码不完全所以不敢乱给你改
sdxy@zj.com
我给你修改
<select name="Gs_QuyuD" id="Gs_QuyuD" >
<option value="">====产品类别====</option>
<%
Set TypeList = conn.Execute("Select * From Quyu_Da Order By Quyu_DSortID")
If Not TypeList.Eof Then
While Not TypeList.Eof
Response.Write "<option value=‘"&TypeList("Quyu_DID")&"’ "
If TypeList("Quyu_DID") =InfoRead("Gs_QuyuD")Then Response.Write " selected"
end if
Response.Write ">"&TypeList("Quyu_DTitle")&"</option>"
TypeList.Movenext
Wend
End If
%>
</select>