举例 首页 只显示10 条
rst.open "select top 10 标题在数据库中存放字段,自动编号字段 from 表名 order by 自动编号字段 desc" (这里倒排序 为了 得到的10条数据 是按照数据库中最新的记录来排序)
for i=1 to 10
response.write "<a href=***.asp?id=" &rst("自动编号字段")& " target=_blank>" &rst("标题字段")& "</a>"
rst.movenext
next
rst.close
然后在***.asp里
dim id
id=request.querystring("id")
rst.open "select 文章内容字段 from 表名 where 自动编号字段="&id
response.write rst("文章内容字段")
rst.close
你的file.asp内容:<!--#include file="include/conn.asp"-->
<%
id=request.querystring("id")
set rs=server.createobject("adodb.recordset")
sql="select capital,content from history where id="&id
rs.open sql,conn,1,1
%>
这部分要写到
a href="file.asp?<%=rs("id")%>"><%=rs("capital")%></a></li>