|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想法是和程序员的想法不一样的.至于为什么.大家去想一想.跟心理学有关的数据|数据库|下拉ASP文件:
<%@Language=VBScript%>
<%OptionExplicit%>
<html>
<head>
<title>List</title>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<%
dimconn
dimrs
dimsql
dimcount
dimrs1
dimsql1
setconn=server.CreateObject("adodb.connection")
conn.Open"test","sa",""
sql="select*fromdistrictorderbylocationidasc"
setrs=conn.execute(sql)
%>
<scriptlanguage="JavaScript">
varonecount;
onecount=0;
subcat=newArray();
<%
count=0
dowhilenotrs.eof
%>
subcat[<%=count%>]=newArray("<%=trim(rs("districtname"))%>","<%=trim(rs("locationid"))%>","<%=trim(rs("districtid"))%>");
<%
count=count+1
rs.movenext
loop
rs.close
setrs=nothing
%>
onecount=<%=count%>;
functionchangelocation(locationid)
{
document.myform.smalllocation.length=0;
varlocationid=locationid;
vari;
document.myform.smalllocation.options[0]=newOption(====一切区域====,);
for(i=0;i<onecount;i++)
{
if(subcat[i][1]==locationid)
{
document.myform.smalllocation.options[document.myform.smalllocation.length]=newOption(subcat[i][0],subcat[i][2]);
}
}
}
</script>
</head>
<body>
<formname="myform"method="post">
<selectname="biglocation"onChange="changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value)">
<%
sql1="select*fromlocationorderbylocationnameasc"
setrs1=conn.Execute(sql1)
dowhilenotrs1.eof
%>
<optionvalue="<%=trim(rs1("locationid"))%>"><%=trim(rs1("locationname"))%></option>
<%
rs1.movenext
loop
rs1.close
setrs1=nothing
conn.Close
setconn=nothing
%>
</select>
<selectname="smalllocation">
<optionselectedvalue="">==一切区域==</option>
</select>
</form>
<scriptLANGUAGE="javascript">
changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value);
</script></p>Access是一种桌面数据库,只适合数据量少的应用,在处理少量数据和单机访问的数据库时是很好的,效率也很高。但是它的同时访问客户端不能多于4个。access数据库有一定的极限,如果数据达到100M左右,很容易造成服务器iis假死,或者消耗掉服务器的内存导致服务器崩溃。 |
|