数据库中有三个表,表Area 有字段:ID,area 表Route有字段:ID,AID,Route 表Building 有字段:ID,AID,Building
用三个下拉列表框从表中分别读出 area、 Route、Building 的内容,要求:当选择area时,Route中只能看到表Route中AID字段值等于表Area中ID值的记录。请问如何实现?
请各位帮看一下以下代码: 以下代码未实现这个功能,请知道者说一下如可实现?谢谢!!!
<select size="1" name="sel1" style="background-color: #F5F5F5">
<option value="" selected>所在区</option>
<% sqlcmd2="Select * From area"
rs2.open sqlcmd2,conn,3,2
Do while not rs2.eof
response.write"<option value="&rs2("area")&">"&rs2("area")&"</option>"
rs2.movenext
loop
rs2.close
%>
</select>*
<select size="1" name="sel2" style="background-color: #F5F5F5" >
<option value="" selected>请选择您所在的路段</option>
<% sqlcmd2="Select * From route"' where EID="&sel1
rs2.open sqlcmd2,conn,3,2
Do while not rs2.eof
response.write"<option value='"&rs2("route")&"'>"&rs2("route")&"</option>"
rs2.movenext
loop
rs2.close
%>
</select>*
<select size="1" name="sel3" style="background-color: #F5F5F5">
<option value="" selected>办公楼</option>
<% sqlcmd2="Select * From building"' where EID="&sel1
rs2.open sqlcmd2,conn,3,2
Do while not rs2.eof
response.write"<option value='"&rs2("building")&"'>"&rs2("building")&"</option>"
rs2.movenext
loop
rs2.close
%>