一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

在不刷新页面的情况下调用远程asp脚本

时间:2022-06-30 11:28:43 编辑:袖梨 来源:一聚教程网

1.请在sql server 中建一数据库 name:house 在house中运行下列脚本
if exists (select * from sysobjects where id = object_id(N'[dbo].[City]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[City]
GO
if exists (select * from sysobjects where id = object_id(N'[dbo].[Area]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Area]
GO
CREATE TABLE [dbo].[City] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[name] [nvarchar] (10) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Area] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[CityId] [int] NULL ,
[name] [nvarchar] (20) NULL
) ON [PRIMARY]
GO
INSERT INTO City (id,name) Values(1,"广州")
INSERT INTO City (id,name) Values(2,"上海")
INSERT INTO City (id,name) Values(3,"北京")
INSERT INTO Area (id,CityId,name) Values(1,1,"天河")
INSERT INTO Area (id,CityId,name) Values(2,1,"白云")
INSERT INTO Area (id,CityId,name) Values(3,2,"虹口")
INSERT INTO Area (id,CityId,name) Values(4,2,"宝山")
INSERT INTO Area (id,CityId,name) Values(5,2,"静安")
INSERT INTO Area (id,CityId,name) Values(6,3,"海淀")
INSERT INTO Area (id,CityId,name) Values(7,3,"朝阳")
2.建立文件
建立文件CityData.asp
<%@ LANGUAGE=VBSCRIPT %>
<% RSDispatch %>