28,391
社区成员
发帖
与我相关
我的任务
分享
<%
set rs = server.CreateObject("adodb.recordset")
sql="select * from [表3] order by [自动编号] asc"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
%>
<%
for i=0 to rs.pagesize-1
%>
<table width="291" height="272" border="1" cellpadding="1" cellspacing="0" bordercolor="#A3DBFF" id="xtable">
<tr>
<td width="125" align="center">照片 </td>
<td width="27">编号 </td>
<td width="125"> <%=rs("id")%> </td>
</tr>
<tr>
<td rowspan="6" align="center"> <a href=" <%=rs("xphoto")%>" rel="lightbox[plants]"> <img width="120" height="160" src=" <%=rs("xphoto")%>" /> </img> </a> </td>
<td>姓名 </td>
<td> <%=rs("xname")%> </td>
</tr>
<tr>
<td>性别 </td>
<td> </td>
</tr>
<tr>
<td>年龄 </td>
<td>
<%
user=session("user")
if user="" Then
response.Write "**游客不显示**"
else
%>
<%=rs("xqq")%>
<%
end if
%> </td>
</tr>
<tr>
<td height="54" >电话 </td>
<td>
<%
user=session("user")
if user="" Then
response.Write "**游客不显示**"
else
%>
<%=rs("xphone")%>
<%
end if
%> </td>
</tr>
<tr>
<td height="54" >工作 </td>
<td> <%=rs("xwork")%> </td>
</tr>
<tr>
<td height="36">现今 <br />
地址 </td>
<td> <%=rs("xaddress")%> </td>
</tr>
<tr>
<td height="48" align="center">其他信息 </td>
<td colspan="2"> <p> <%=rs("xother")%> </p> </td>
</tr>
</table>
<%
rs.movenext()
next
%>
<p> </p>
<div id="foot1"> <a href="xdata.asp">首页 </a>
<%if pre then%>
<a href="xdata.asp?page= <%=intpage -1%>">上页 </a>
<%end if%>
<%if last then %>
<a href="xdata.asp?page= <%=intpage +1%>"> 下页 </a>
<%end if %>
<a href="xdata.asp?page= <%=rs.PageCount%>">尾页 </a>
<%
loop
end if
set rs=nothing
conn.close()
%>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="inc/Conn.asp" -->
<%response.charset="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<%
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from qwer order by id desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("暂时没有记录")
else
%>
<%
rs.PageSize=10
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
%>
<tr>
<td height="24" align="center" ><table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="18%" rowspan="4" align="center"><img src="<%=rs("bq")%>" alt="" /></td>
<td width="82%" align="left">作者:<%=rs("UserName")%></td>
</tr>
<tr>
<td align="left">主题:<%=rs("Title")%></td>
</tr>
<tr>
<td align="left">时间:<%=rs("sj")%></td>
</tr>
<tr>
<td align="left"><%=rs("content")%></td>
</tr>
</table></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
%>
<tr valign="bottom">
<td height="50" align="center" ><form method="post" action="?">
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=Index.asp?page=1>首页</a> "
response.write "<a href=Index.asp?page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=Index.asp?page=" & (page+1) & ">"
response.write "下一页</a> <a href=Index.asp?page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
response.write " 共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录 <b>"&rs.pagesize&"</b>条记录/页"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span></p>"
%>
</form></td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
</table>
</body>
</html>
<%
dim conn,db
dim connstr
db="database/aa.mdb" '数据库文件位置
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err then
err.clear
else
conn.open connstr
end if
sub CloseConn()
conn.close
set conn=nothing
end sub
%>