asp入门实例读取数据库|asp入门实例-读取数据库程序

时间:2016-03-09  来源:ASP入门  阅读:







words" content="" />








<%
i=0
set rs=server.createobject("adodb.recordset") 
sql ="select * from 表 order by 日期 Desc"
rs.open sql,conn,1,1
if rs.eof then
%>
没有文章
<%
else
do while not rs.eof
%>
" target="_blank"><%=rs("标题")%>
<%
i=i+1
if i>=8 then exit do     "显示条数
rs.movenext
loop
end if
rs.close
%>




广告位置


<%
i=0
set rs=server.createobject("adodb.recordset") 
sql ="select * from 表 where 自动排列字段 not in (select top 10 自动排列字段 from 表 order by 日期 Desc) order by 日期 Desc"
rs.open sql,conn,1,1
if rs.eof then
%>
没有文章
<%
else
do while not rs.eof
%>
" target="_blank"><%=rs("标题")%>
<%
i=i+1
if i>=8 then exit do     "显示条数
rs.movenext
loop
end if
rs.close
%>




asp入门实例读取数据库|asp入门实例-读取数据库程序

http://m.bbyears.com/aspjiaocheng/22293.html

推荐访问:
相关阅读 猜你喜欢
本类排行 本类最新