标题:[求助]SQL
取消只看楼主
yonyon275
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-10-26
 问题点数:0 回复次数:0 
[求助]SQL
<%
sql = "select *,ShowTime = convert(char(20),CreateDate,120) from TArticle where IfCommand = 'Y' and IfIssue = 'Y' and ArtType <> '004' order by CreateDate desc"
set rs = conn.execute(sql)
ShowTime = rs("ShowTime")
i = 0
do while not rs.eof and i<11
select case rs("ArtType")
case "000"
sql = "select * from TArticleInformation where ArticleId = '"+rs("ArticleId")+"'"
set rsInf = conn.execute(sql)
if not rsInf.eof then
sTitle = rsInf("Title")
Information = "标题:"+rsInf("Title")+" 作者:"+rsInf("Auther")+" 发布时间:"+ShowTime+" 点击率:"+cstr(rs("ClickNum"))
end if
rsInf.close
case "001"
sql = "select * from TLibrary where ArticleId = '"+rs("ArticleId")+"'"
set rsInf = conn.execute(sql)
if not rsInf.eof then
sTitle = rsInf("Title")
Information = "标题:"+rsInf("Title")+chr(13)+"作者:"+rsInf("Auther")+chr(13)+"发布时间:"+ShowTime+chr(13)+"点击率:"+cstr(rs("ClickNum"))
end if
rsInf.close
case "002"
sql = "select * from TCultural where ArticleId = '"+rs("ArticleId")+"'"
set rsInf = conn.execute(sql)
if not rsInf.eof then
sTitle = rsInf("Title")
Information = "标题:"+rsInf("Title")+chr(13)+"发布时间:"+ShowTime+chr(13)+"点击率:"+cstr(rs("ClickNum"))
end if
rsInf.close
case "003"
sql = "select * from TDynamic where ArticleId = '"+rs("ArticleId")+"'"
set rsInf = conn.execute(sql)
if not rsInf.eof then
sTitle = rsInf("Title")
Information = "标题:"+rsInf("Title")+chr(13)+"作者:"+rsInf("Auther")+chr(13)+"发布时间:"+ShowTime+chr(13)+"点击率:"+cstr(rs("ClickNum"))
end if
rsInf.close
end select
%>

哪位大虾解释下哦 谢谢咯?
搜索更多相关主题的帖子: SQL 
2006-11-06 13:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-101047-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.097625 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved