1. sqlserver:house and nower in houseでデータベース名を作成してください
ifexists(select*fromsysobjectswhereid = object_id(n´[dbo]。[city] ´)andobjectproperty(id、n´isusertable´)= 1)
droptable [dbo]。[都市]
行く
ifexists(select*fromsysobjectswhereid = object_id(n´[dbo]。[area] ´)andobjectproperty(id、n´isusertable´)= 1)
droptable [dbo]。[エリア]
行く
createTable [dbo]。[都市](
[id] [int] ID(1,1)notnull、
[name] [nvarchar](10)null
)[プライマリ]
行く
createTable [dbo]。[領域](
[id] [int] ID(1,1)notnull、
[cityid] [int] null、
[name] [nvarchar](20)null
)[プライマリ]
行く
InsertIntocity(id、name)values(1、 "広州")
InsertIntocity(id、name)values(2、 "shanghai")
InsertIntocity(id、name)values(3、 "Beijing")
InsertIntoarea(id、cityid、name)values(1,1、 "tianhe")
InsertIntoarea(id、cityid、name)values(2,1、 "White Cloud")
InsertIntoarea(id、cityid、name)values(3,2、 "hongkou")
InsertIntoarea(id、cityid、name)values(4,2、 "baoshan")
InsertIntoarea(id、cityid、name)values(5,2、 "jing'an")
InsertIntoarea(id、cityid、name)values(6,3、 "haidian")
InsertIntoarea(id、cityid、name)values(7,3、 "chaoyang")
2。ファイルを作成します
ファイルCityData.aspを作成します
<%@言語= vbscript%>
<%rsdispatch%>
<scriptrunat = serverLanguage = javascript>
<! - #includevirtual = "/_ scriptLibrary/rs.asp" - >
<! - #includevirtual = "/jsconn.asp" - >
functiondescription()
{
this.getareaasArray = dogetData;
}
public_description = newdescription();
functiondogetdata(cityid)
{
varsql、rst、strtext、conn、i、j
conn = newActiveXObject( "adodb.Connection");
conn.ConnectionString = connstr;
conn.ConnectionTimeout = 30;