主题:目录选择问题,请各位帮帮忙
我想选择一级目录和相应的二级目录,想下面的代码,但一直实现不了,选择了一级目录,二级目录没有反映啊,各位帮帮忙吧,该怎么办,谢谢~~~~!
<tr>
<td width="16%" height="25">选择分类:</td>
<td width="84%" height="25">
<%
connstr="DBQ="+server.mappath("database/database.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rsb=server.createobject("adodb.recordset")
sqlb = "select * from gqlb "
rsb.open sqlb,conn,1,1
if rsb.eof and rsb.bof then
response.write "请先添加栏目。"
else
%>
<select name="lbid" onChange="changelocation(document.myform.lbmc.options[document.myform.lbmc.selectedIndex].value)" size="1">
<option selected value="<%=trim(rsb("lbid"))%>"><%=trim(rsb("lbmc"))%></option>
<%
dim selclass
selclass=cstr(rsb("lbid"))
rsb.movenext
do while not rsb.eof
%>
<option value="<%=trim(rsb("lbid"))%>"><%=trim(rsb("lbmc"))%></option>
<%
rsb.movenext
loop
end if
rsb.close
%>
</select>
<select name="lbid1">
<option value="" selected>不指定小类</option>
<%
connstr="DBQ="+server.mappath("database/database.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rsss=server.createobject("adodb.recordset")
sqlss="select * from gqlb1 where gqlb="&selclass&""
rsss.open sqlss,conn,1,1
if not(rsss.eof and rsss.bof) then
%>
<option value="<%=rsss("id")%>"><%=rsss("gqlb1")%></option>
<% rsss.movenext
do while not rsss.eof%>
<option value="<%=rsss("id")%>"><%=rsss("gqlb1")%></option>
<%
rsss.movenext
loop
end if
rsss.close
%>
</select></td>
</tr>
<tr>
<td width="16%" height="25">选择分类:</td>
<td width="84%" height="25">
<%
connstr="DBQ="+server.mappath("database/database.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rsb=server.createobject("adodb.recordset")
sqlb = "select * from gqlb "
rsb.open sqlb,conn,1,1
if rsb.eof and rsb.bof then
response.write "请先添加栏目。"
else
%>
<select name="lbid" onChange="changelocation(document.myform.lbmc.options[document.myform.lbmc.selectedIndex].value)" size="1">
<option selected value="<%=trim(rsb("lbid"))%>"><%=trim(rsb("lbmc"))%></option>
<%
dim selclass
selclass=cstr(rsb("lbid"))
rsb.movenext
do while not rsb.eof
%>
<option value="<%=trim(rsb("lbid"))%>"><%=trim(rsb("lbmc"))%></option>
<%
rsb.movenext
loop
end if
rsb.close
%>
</select>
<select name="lbid1">
<option value="" selected>不指定小类</option>
<%
connstr="DBQ="+server.mappath("database/database.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rsss=server.createobject("adodb.recordset")
sqlss="select * from gqlb1 where gqlb="&selclass&""
rsss.open sqlss,conn,1,1
if not(rsss.eof and rsss.bof) then
%>
<option value="<%=rsss("id")%>"><%=rsss("gqlb1")%></option>
<% rsss.movenext
do while not rsss.eof%>
<option value="<%=rsss("id")%>"><%=rsss("gqlb1")%></option>
<%
rsss.movenext
loop
end if
rsss.close
%>
</select></td>
</tr>