注册 登录
编程论坛 ASP.NET技术论坛

调用数据库中的第8以后的文章,杂改,谢谢

baisl100 发布于 2011-07-11 07:59, 367 次点击
set rs9=server.CreateObject("ADODB.RecordSet")
rs9.Source="select top 7 * from "& db_News_Table &" where istop=1 order by newsid desc"
rs9.Open rs9.Source,conn,1,1
do while not rs9.EOF
title=trim(rs9("title"))
4 回复
#2
baisl1002011-07-11 08:54
<%
                            set rs9=server.CreateObject("ADODB.RecordSet")
                            rs9.Source="select top 7 * from "& db_News_Table &" where istop=1 order by newsid desc"
                            rs9.Open rs9.Source,conn,1,1
                            do while not rs9.EOF
                            title=trim(rs9("title"))
                        %>
                      <img src="images/dot_blue.gif"> <a class=middle target="_blank" href="ReadNews.asp?NewsId=<%=rs9("newsid")%>" title="<%=htmlencode4(title)%>"> <font color=<%=rs9("titlecolor")%>>[<%=CutStr(htmlencode4(rs9("title")),20)%>]</font> </a> <a class=middle target="_blank" href="ReadNews.asp?NewsId=<%=rs9("newsid")%>" title="<%=htmlencode4(title)%>"><%=CutStr(nohtml(rs9("Content")),15)%></a>
                      <!--评-->
                      <%if reviewable="1" then%>
                      <% if rs9("titlesize")>=1 then %>
                      <A class=middle HREF="<%=path%>Review.asp?NewsID=<%=rs9("NewsID")%>" target="_blank" > <font color=red><b>评</b></font></A>
                      <%end if %>
                      <%end if %>
                      <!--评-->
                      <br>
                      <%
                            rs9.movenext
                            loop
                            rs9.close
                            set rs9=nothing
                        %>
#3
wangnannan2011-07-11 16:28
select top 7 * from "& db_News_Table &" where istop=1 order by newsid desc

select * from  "& db_News_Table &"  where istop=1 and newsid not in (select top 7 newsid from "& db_News_Table &" where istop=1) order by newsid desc
#4
baisl1002011-07-11 18:29
谢谢,问题已经解决,谢谢了
#5
baisl1002011-07-11 18:34
我用的是:
<%
dim jishu
jishu = 0
                            set rs9=server.CreateObject("ADODB.RecordSet")
                            rs9.Source="select top 14 * from "& db_News_Table &" where istop=1 order by newsid desc"
                            rs9.Open rs9.Source,conn,1,1
                            do while not rs9.EOF
                            title=trim(rs9("title"))
                            jishu = jishu + 1
                            If (jishu > 7) Then
                        %>
1