34,594
社区成员
发帖
与我相关
我的任务
分享
create table menu(code varchar(10),remark nvarchar(40),link varchar(100))
insert into menu select '01','财经生活',''
insert into menu select '0101','社会','http://www.xyz.com/society/
insert into menu select '0102','家庭','http://www.xyz.com/family/
insert into menu select '02','特色栏目',''
insert into menu select '0201','股市幕后','http://www.xyz.com/shares/
insert into menu select '0202','中证内参','http://www.xyz.com/low-down/
在网页程序中这样:
连接数据库服务器
执行查询:
select code,remark,link from menu order by code
获得记录集RS
设置列表框
while not rs.eof
if len(rs("code"))>2 then
response.write "<a href=" & rs("link") & ">--" & rs("remark") & "</a>"
else
response.write rs("remark") & "(封面频道)"
end if
rs.movenext
wend
create table menu(code varchar(10),remark nvarchar(40),link varchar(100))
insert into menu select '01','财经生活',''
insert into menu select '0101','社会','http://www.xyz.com/society/
insert into menu select '0102','家庭','http://www.xyz.com/family/
insert into menu select '02','特色栏目',''
insert into menu select '0201','股市幕后','http://www.xyz.com/shares/
insert into menu select '0202','中证内参','http://www.xyz.com/low-down/
在网页程序中这样:
连接数据库服务器
执行查询:
select code,remark,link from menu order by code
获得记录集RS
设置列表框
while not rs.eof
if len(rs("code"))>2 then
response.write "<a href=" & rs("link") & ">--" & rs("remark") & "</a>"
else
response.write rs("remark") & "(封面频道)"
end if
rs.movenext
wend
--modify
create table menu(code varchar(50),--编码
pid varchar(50), --父编码
remark nvarchar(40)) --名称
--代码这样,可以进行多级延伸。
insert into menu select '01','','财经生活(封面频道)'
insert into menu select '01.01','01','社会'
insert into menu select '01.02','01','家庭'
insert into menu select '02','','特色栏目((封面频道))'
insert into menu select '02.01','02','股市幕后'
insert into menu select '02.02','02','中证内参'
create table menu(code varchar(10),--编码
pid int, --父编码
remark nvarchar(40)) --名称
--代码这样,可以进行多级延伸。
insert into menu select '01','','财经生活(封面频道)'
insert into menu select '01.01','01','社会'
insert into menu select '01.02','01','家庭'
insert into menu select '02','','特色栏目((封面频道))'
insert into menu select '02.01','02','股市幕后'
insert into menu select '02.02','02','中证内参'
create table menu
([id] int identity(1,1),pid int,mName nvarchar(40))
insert into menu
select 0,'财经生活(封面频道)'
union all
select 1,'社会'
union all
select 1,'家庭'
union all
select 0,'特色栏目((封面频道))'
union all
select 4,'股市幕后'
union all
select 4,'中证内参'