ASP读取数据显示示例
<%@ LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asp"-->//引入数据库连接
<!--#include file="inc/chk.asp"--> //登录权限设置
<%
if session("rank")>2 then'判断管理员权限
call Msgbox("你的权限不够!","Back","None")
response.End
end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from g_uang order by photo_time desc"
rs.open sql,conn,1,3
%>
<!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=gb2312" />
<title>广告管理</title>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body>//CodeGo.net/
<!--#include file="hou_tai.asp"-->//引入管理模块
<table width="700" height="360" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="10" height="368" valign="top" background="../images/left0.gif"><p> </p></td>
<td width="819" valign="top"><table width="693" height="188" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="533" height="33"><font color="#990000" size="-1">代号3=留言1:代号4=留言2:代号6=像册1翻页</font></td>
<td width="160" valign="bottom"> </td>
</tr>
<tr>
<td height="155" colspan="2"><%
If(rs.Eof)Then
Response.Write("暂无照片信息!")
Else
%>
<table width="665" border="1" align="center" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#B1C7EC">
<tr>
<td width="60" height="30" align="center" nowrap="nowrap"><div align="center" class="STYLE2">广告编号</div></td>
<td width="90" align="center" nowrap="nowrap"><div align="center" class="STYLE2">信息</div></td>
<td width="146" align="center" nowrap="nowrap"><div align="center" class="STYLE2">广告代号</div></td>
<td width="162" align="center" nowrap="nowrap"><div align="center" class="STYLE2">发布时间</div></td>
<td width="113" align="center" nowrap="nowrap"><div align="center" class="STYLE2">名称</div></td>
<td colspan="2" align="center" nowrap="nowrap"><div align="center" class="STYLE2">操作</div></td>
</tr>
<%
'分页
rs.pagesize=8
page1=clng(request("page1"))
if page1<1 then page1=1
rs.absolutepage=page1
for i=1 to rs.pagesize
k=rs("p_hoto")
%>
<tr>
<td height="32" align="center"><div align="center" class="STYLE2"><%=rs("ID")%> </div></td>
<td align="center" class="STYLE2"><div align="center"><a href="#" onClick="Javascript:window.open('al_xianxi.asp?ID=<%=rs("ID")%>','','width=400,height=320')"><%=rs("name1")%></a> </div></td>
<td align="center" class="STYLE2"><div align="center"><%=rs("p_hoto")%> </div></td>
<td align="center" class="STYLE2"><div align="center"><%=rs("photo_time")%> </div> </td>
<td align="center" class="STYLE2"><div align="center"><%=rs("picture")%></div> </td>
<td width="40" align="center"><div align="center" class="STYLE2"><a href="#" onClick="JScript:window.open('xiu_update.asp?id=<%=rs("id")%>','','width=500,height=365')">修改</a>
</div></td>
<td width="38" align="center"><div align="center" class="STYLE2">
<a href="#" onClick="if(confirm('是否确认删除?'))
{window.location.href='alb_umdel.asp?id=<%=rs("id")%>';}">删除</a></div> </td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
%>
<tr>
<td height="30" colspan="7" nowrap="nowrap"><div align="right">
<table width="624" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="right" class="STYLE2">
<% if page1<>1 then%>
<a href="<%=path1%>?page1=1">第一页</a>
<a href="<%=path1%>?page1=<%=(page1-1)%>"> 上一页</a>
<%end if %>
<%if page1<>rs.pagecount then%>
<a href="<%=path1%>?page1=<%=(page1+1)%>">下一页</a>
<a href="<%=path1%>?page1=<%=rs.pagecount%>" >最后一页</a>
<%end if%>
</div></td>
</tr>
</table>
</div></td>
</tr>
</table>
<%end if%>
</td>
</tr>
</table> <p> </p>
</td>
<td width="10" valign="top" background="../images/right0.gif"> </td>
</tr>
</table>
</body>
</html>