<%
session("typeidid")=1
set rst=server.createobject("adodb.recordset")
strsql="select * from xinxi where typeid=1 order by shijian desc"
rst.open strsql,1,1
i=1
do while not rst.eof and i<=5
%>
<div style="padding-left:120px;line-height:40px">
<img src="image/tiao1.jpg">
<a href="rightxx.asp?xinxiid=<%=rst("xinxiid")%>"><%=rst("biaoti")%>
(<%=rst("shijian")%> 已点击:<%=rst("hitnum")%>)
<%if rst("tuijian")=0 then%>
<img src="image/bg3.gif" border=0>
<%end if%>
</a>
</div>
<%i=i+1
rst.movenext
loop
rst.close
set rst=nothing%>
conn.asp是包含进来的,原文件如下:
<%
set conn=server.createobject("adodb.connection")
db="date/workdate.mdb"
connstr="driver={microsoft access driver (*.mdb)};dbq=" & server.mappath(db)
conn.open connstr
sub closeconn()
conn.close
set conn=nothing
end sub
%>