asp省市级联问题?线上等,急!加在50分

来源:百度知道 编辑:UC知道 时间:2024/05/28 08:06:40
ACCESS数据库,表名是:Sort
数据如下:
id name Parentid Order
1 北京市 0 0
2 河北省 0 1
3 广东省 0 2
4 石家庄市 2 0
5 张家口市 2 1
6 秦皇岛市 2 2
7 唐山市 2 3
8 广州市 3 0
9 深圳市 3 1
10 惠州市 3 2
...
省市都在这个表里.想通过ASP实现省市级联.
代码怎么写?谢谢!急,加50分
<%
set rs=server.createobject("ADODB.RECORDSET")
rs.open "select * from Sort where Parentid=0 order by Order",conn,1,1
if rs.eof and rs.bof then
response.write "请先添加省!
response.end
else
%>
<select name="province" size="1" id="province" onChange="changelocation(document.form.province.options[document.form.province.selectedIndex].value)">
<option selected value="<%=rs("Id")%>"><%=trim(rs("Name"))%></

给你个多级菜单级联的示例,我没根据你的数据库改,你自己改一下

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>多级关联菜单数据库版</title>
<!--
数据库:test.mdb
表:dbselect
表结构:id(自增) school(文本) department(文本) grade(文本) student(文本)
IE6,NS7,Mozilla下测试通过
-->
</head>
<body>

<form name="frm" method="post" action="<%=Request.ServerVariables("PATH_INFO")%>">
<select name=school onchange="MulSelect(1)">
</select>
<select name=department onchange="MulSelect(2)"></select>
<select name=grade onchange="MulSelect(3)"></select>
<select name