Call the remote ASP script without refreshing the page

zhaozj2021-02-11  216

1. Construct a database in SQL Server Name: House run the following script in House

IF exists (Select * from sysobjects where id = Object_id (n '[dbo]. [city]') And ObjectProperty (ID, n'susertable ') = 1)

Drop Table [dbo]. [City]

Go

IF exists (select * from sysobjects where id = Object_id (n '[dbo]. [area]') And ObjectProperty (id, n'uSERTABLE ') = 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,

[City] [int] null,

[Name] [NVARCHAR] (20) NULL

) On [primary]

Go

INSERT INTO City (ID, Name) Values ​​(1, "Guangzhou")

INSERT INTO City (ID, Name) Values ​​(2, "Shanghai")

INSERT INTO City (ID, Name) Values ​​(3, "Beijing")

INSERT INTO Area (ID, CityID, Name) Values ​​(1, 1, "Tianhe")

INSERT INTO Area (ID, CityID, Name) Values ​​(2, 1, "Baiyun")

INSERT INTO Area (ID, CityID, Name) Values ​​(3, 2, "Hongkou")

Insert Into Area (ID, CityID, Name) Values ​​(4, 2, "Baoshan")

INSERT INTO Area (ID, CityID, Name) Values ​​(5, 2, "Jing'an")

INSERT INTO Area (ID, CityID, Name) Values ​​(6, 3, "Haidian")

INSERT INTO Area (ID, CityID, Name) Values ​​(7, 3, "Chaoyang")

2. Create a file

Create files for CITYDATA.ASP

<% @ Language = VBScript%>

<% Rsdispatch%>