12 个解决方案
#1
使用存储过程分页!
#2
我是想要代码,不是要思想,谢谢
#3
或者例子
#4
<!--#include file="../include/sql.asp"-->
<!--#include file="../include/ubb.asp"-->
<!--#include file="../include/indexconn.asp"-->
<p align="center"><!--#include file="top1.asp" --></p>
<table width="760" align="center" cellpadding="0" cellspacing="0" class="table-zuoyou">
<tr>
<td width="170" height="350" valign="top" class="table-you">
</td>
<td height="350" valign="top">
<%
Call opendb(0)
If Request("Page")=Empty Then
Page=1
Else
Page=cint(Request("Page"))
End If
key=trim(Request("key"))
key=Replace(key, "'", "''")
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from TProductInfo where (Fs_PCode like '%" & key & "%' or Fs_Code like '%" & key & "%' or Fs_GoodsType like '%" & key & "%' or Fs_ProductType like '%" & key & "%' or Fs_ProductClass like '%" & key & "%' or Fs_Brand like '%" & key & "%' or Fs_Intro like '%" & key & "%' or Fs_Rem like '%" & key & "%') order by Fs_PCode"
rs.open sql,conn,1,1
if rs.eof then
response.write "<br>非常抱谦,未找到符合您搜索关键字的信息。"
end if
rs.pagesize = 20
if request("page")="" or isempty(request("page")) then
page = 1
else
page=int(request("page"))
end if
if page>rs.pagecount then
page=rs.pagecount
end if
if not rs.BOF then
Rs.Move Rs.PageSize*(page-1)
end if%> <br>
<table width="98%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"> 符合搜索关键字"<font color=#ff0000><%=key%></font>"的,共有<%=rs.RecordCount%>笔资料,每页显示<%=RS.PageSize%>笔,目前显示第<font color=#ff0000><%=page%></font>/<%=rs.pagecount%>页</td>
</tr>
</table>
<table width="98%" align="center" cellpadding="5" cellspacing="0" class="table-shang">
<%
i=1
do while not rs.eof and i<=rs.pagesize
%><tr>
<td width="120" height="100" align="center" valign="middle"><a href="/ProductInfo.asp?SerNo=<%=rs("Fs_PCode")%>" onFocus="this.blur()"><img src="<%=rs("Fs_Picture")%>" width="75" height="75" border="0"></a></td>
<td valign="top"><a href=/ProductInfo.asp?SerNo=<%=rs("Fs_PCode")%>>
<%mc=rs("Fs_Name")
If xz="mc" Then
mc=Replace(mc, key ,"<font color=#ff0000>"&key&"</font>")
end if
response.write mc%>
</a><br>
市场价:<s>¥<%=rs("Fd_MarketPrice")%>元</s> 中维价:¥<%=rs("Fd_MemberPrice")%>元<br>
简评:
<%jp=left(rs("Fs_Rem"),100)
If xz="jp" Then
jp=Replace(jp, key ,"<font color=#ff0000>"&key&"</font>")
end if
response.write jp%>
<br>
</td>
</tr><%
i=i+1
rs.MoveNext
loop
%>
</table>
<table width="98%" height="30" align="center" cellpadding="0" cellspacing="0">
<form name=form method=post action=?key=<%=request("key")%>>
<tr>
<td valign="bottom"> <%
if rs.recordcount<>0 then
if page-1 mod 10=0 then
p=(page-1) \ 10
else
p=(page-1) \ 10
end if
response.write " >>分页:"
if p*10>0 then response.write "<a href='?key="&request("key")&"&page="&p*10&"' title=上十页>[上十页]</a> "
uming_i=1
for ii=p*10+1 to P*10+10
if ii=page then
response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
else
response.write "<a href='?key="&request("key")&"&page="&ii&"'>["+Cstr(ii)+"]</a> "
end if
if ii=rs.pagecount then exit for
uming_i=uming_i+1
next
if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?key="&request("key")&"&page="&ii&" 'title=下十页>[下十页]</a> "
response.write(" 跳页:<input type=text name=page size=2 maxlength=3 class=wenbenkuang> <input type=submit name=Submit2 value=Go class=go-wenbenkuang>")
end if%> </td>
</tr>
</form>
</table></td>
</tr>
</table>
<!--#include file="../include/ubb.asp"-->
<!--#include file="../include/indexconn.asp"-->
<p align="center"><!--#include file="top1.asp" --></p>
<table width="760" align="center" cellpadding="0" cellspacing="0" class="table-zuoyou">
<tr>
<td width="170" height="350" valign="top" class="table-you">
</td>
<td height="350" valign="top">
<%
Call opendb(0)
If Request("Page")=Empty Then
Page=1
Else
Page=cint(Request("Page"))
End If
key=trim(Request("key"))
key=Replace(key, "'", "''")
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from TProductInfo where (Fs_PCode like '%" & key & "%' or Fs_Code like '%" & key & "%' or Fs_GoodsType like '%" & key & "%' or Fs_ProductType like '%" & key & "%' or Fs_ProductClass like '%" & key & "%' or Fs_Brand like '%" & key & "%' or Fs_Intro like '%" & key & "%' or Fs_Rem like '%" & key & "%') order by Fs_PCode"
rs.open sql,conn,1,1
if rs.eof then
response.write "<br>非常抱谦,未找到符合您搜索关键字的信息。"
end if
rs.pagesize = 20
if request("page")="" or isempty(request("page")) then
page = 1
else
page=int(request("page"))
end if
if page>rs.pagecount then
page=rs.pagecount
end if
if not rs.BOF then
Rs.Move Rs.PageSize*(page-1)
end if%> <br>
<table width="98%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"> 符合搜索关键字"<font color=#ff0000><%=key%></font>"的,共有<%=rs.RecordCount%>笔资料,每页显示<%=RS.PageSize%>笔,目前显示第<font color=#ff0000><%=page%></font>/<%=rs.pagecount%>页</td>
</tr>
</table>
<table width="98%" align="center" cellpadding="5" cellspacing="0" class="table-shang">
<%
i=1
do while not rs.eof and i<=rs.pagesize
%><tr>
<td width="120" height="100" align="center" valign="middle"><a href="/ProductInfo.asp?SerNo=<%=rs("Fs_PCode")%>" onFocus="this.blur()"><img src="<%=rs("Fs_Picture")%>" width="75" height="75" border="0"></a></td>
<td valign="top"><a href=/ProductInfo.asp?SerNo=<%=rs("Fs_PCode")%>>
<%mc=rs("Fs_Name")
If xz="mc" Then
mc=Replace(mc, key ,"<font color=#ff0000>"&key&"</font>")
end if
response.write mc%>
</a><br>
市场价:<s>¥<%=rs("Fd_MarketPrice")%>元</s> 中维价:¥<%=rs("Fd_MemberPrice")%>元<br>
简评:
<%jp=left(rs("Fs_Rem"),100)
If xz="jp" Then
jp=Replace(jp, key ,"<font color=#ff0000>"&key&"</font>")
end if
response.write jp%>
<br>
</td>
</tr><%
i=i+1
rs.MoveNext
loop
%>
</table>
<table width="98%" height="30" align="center" cellpadding="0" cellspacing="0">
<form name=form method=post action=?key=<%=request("key")%>>
<tr>
<td valign="bottom"> <%
if rs.recordcount<>0 then
if page-1 mod 10=0 then
p=(page-1) \ 10
else
p=(page-1) \ 10
end if
response.write " >>分页:"
if p*10>0 then response.write "<a href='?key="&request("key")&"&page="&p*10&"' title=上十页>[上十页]</a> "
uming_i=1
for ii=p*10+1 to P*10+10
if ii=page then
response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
else
response.write "<a href='?key="&request("key")&"&page="&ii&"'>["+Cstr(ii)+"]</a> "
end if
if ii=rs.pagecount then exit for
uming_i=uming_i+1
next
if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?key="&request("key")&"&page="&ii&" 'title=下十页>[下十页]</a> "
response.write(" 跳页:<input type=text name=page size=2 maxlength=3 class=wenbenkuang> <input type=submit name=Submit2 value=Go class=go-wenbenkuang>")
end if%> </td>
</tr>
</form>
</table></td>
</tr>
</table>
#5
只需要传入搜索关键字 key
#6
很久以前写的代码,慢慢研读吧
vew.asp程序
主要功能:
在登录窗口中正确输入用户名和密码,或者通过成功注册新用户并单击“登录论坛”
超链接均可进入论坛窗口。在论坛窗口中,显示各用户名、发表的文章题目、有几人回复及文章内容的超链接。在显示这些内容时,主要参考使用了ASP的分页技术。点击文章内容的链接,进入相应的内容窗口。此外,本窗口还包括另外三个链接,其中,点击“我要发言”进入发言窗口,点击“离开论坛”进入离开论坛窗口,点击“管理员入口”进入管理员登录窗口。
①分页:本程序中的分页主要应用RecordSet对象的AbsolutePage、PageCount、PageSize等属性。当指定了PageSize属性后,对AbsolutePage指定值就可以翻转到指定的页面。程序如下:
<%@ Language=VBScript %>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=d:\DBbbs\BBS.mdb"
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY BGCOLOR="#EBEEF3">
<P> <TABLE width="90%" > <TR align=center> <TD> <a href="wordadd1.asp?no=<%Response.write request("no")%>">我要发言</a>
</TD><TD> <a href="leave.asp?no=<%Response.write request("no")%>">离开论坛</a> </TD><TD>
<a href="adminlogin.asp">管理员入口</a> </TD></TR> </TABLE></P> <%
sql="select * from 发言表 where 发言次序=1 order by id desc"
dim rootrs
set rootrs=server.CreateObject("adodb.recordset")
rootrs.Open sql,conn,1,1
if rootrs.BOF or rootrs.EOF then
Response.Write"目前还没有发言内容."
else
set name1=rootrs("发言标题")
set name2=rootrs("用户名")
set name3=rootrs("回复数")
set name4=rootrs("电子信箱")
set num=rootrs("num")
rootrs.PageSize=10
rootrs.AbsolutePage=1
if request("page")<>"" then
rootrs.AbsolutePage=request("page")
end if
rowcount=rootrs.pagesize
%> <center> <%
if not rootrs.eof then
%> <p> <table border="1" cellspacing="0" width="650" height="20" bgcolor="#fdbd6f" cellpadding="4">
<%
do while not rootrs.EOF and rowcount>0
%> <tr> <td width=95 valign=top> <font color=blue><a href="mailto:<%response.write name4%>"><%Response.Write name2%></a></font>
</td><td width=295 valign=top> <font color=darked><%Response.Write name1%></font>
</td><td width=95 valign=top> <font color=darked><%Response.Write name3%>人回复</font>
</td><td width=145 valign=top> <a href="vew2.asp?num=<%=num%>&no=<%Response.write""&request("no")&""%>">言论内容</a></font>
</td></tr> <%
rootrs.MoveNext
rowcount=rowcount-1
loop
end if
if rootrs.PageCount>1 then
Response.Write"<table border=0>"
Response.write"<tr>"
Response.Write"<td><b>帖子分页:</b></td>"
for i=1 to rootrs.PageCount
Response.Write"<td><a href='vew.asp?page="&i&"&no="&request("no")&"'>"
Response.Write"[<b>"&i&"</b>]</a>"
Response.Write"</td>"
next
Response.Write"</tr></table>"
end if
end if
%> </center> <%
rootrs.Close
set rootrs=nothing
conn.close
set conn=nothing
%>
</BODY>
</HTML>
vew.asp程序
主要功能:
在登录窗口中正确输入用户名和密码,或者通过成功注册新用户并单击“登录论坛”
超链接均可进入论坛窗口。在论坛窗口中,显示各用户名、发表的文章题目、有几人回复及文章内容的超链接。在显示这些内容时,主要参考使用了ASP的分页技术。点击文章内容的链接,进入相应的内容窗口。此外,本窗口还包括另外三个链接,其中,点击“我要发言”进入发言窗口,点击“离开论坛”进入离开论坛窗口,点击“管理员入口”进入管理员登录窗口。
①分页:本程序中的分页主要应用RecordSet对象的AbsolutePage、PageCount、PageSize等属性。当指定了PageSize属性后,对AbsolutePage指定值就可以翻转到指定的页面。程序如下:
<%@ Language=VBScript %>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=d:\DBbbs\BBS.mdb"
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY BGCOLOR="#EBEEF3">
<P> <TABLE width="90%" > <TR align=center> <TD> <a href="wordadd1.asp?no=<%Response.write request("no")%>">我要发言</a>
</TD><TD> <a href="leave.asp?no=<%Response.write request("no")%>">离开论坛</a> </TD><TD>
<a href="adminlogin.asp">管理员入口</a> </TD></TR> </TABLE></P> <%
sql="select * from 发言表 where 发言次序=1 order by id desc"
dim rootrs
set rootrs=server.CreateObject("adodb.recordset")
rootrs.Open sql,conn,1,1
if rootrs.BOF or rootrs.EOF then
Response.Write"目前还没有发言内容."
else
set name1=rootrs("发言标题")
set name2=rootrs("用户名")
set name3=rootrs("回复数")
set name4=rootrs("电子信箱")
set num=rootrs("num")
rootrs.PageSize=10
rootrs.AbsolutePage=1
if request("page")<>"" then
rootrs.AbsolutePage=request("page")
end if
rowcount=rootrs.pagesize
%> <center> <%
if not rootrs.eof then
%> <p> <table border="1" cellspacing="0" width="650" height="20" bgcolor="#fdbd6f" cellpadding="4">
<%
do while not rootrs.EOF and rowcount>0
%> <tr> <td width=95 valign=top> <font color=blue><a href="mailto:<%response.write name4%>"><%Response.Write name2%></a></font>
</td><td width=295 valign=top> <font color=darked><%Response.Write name1%></font>
</td><td width=95 valign=top> <font color=darked><%Response.Write name3%>人回复</font>
</td><td width=145 valign=top> <a href="vew2.asp?num=<%=num%>&no=<%Response.write""&request("no")&""%>">言论内容</a></font>
</td></tr> <%
rootrs.MoveNext
rowcount=rowcount-1
loop
end if
if rootrs.PageCount>1 then
Response.Write"<table border=0>"
Response.write"<tr>"
Response.Write"<td><b>帖子分页:</b></td>"
for i=1 to rootrs.PageCount
Response.Write"<td><a href='vew.asp?page="&i&"&no="&request("no")&"'>"
Response.Write"[<b>"&i&"</b>]</a>"
Response.Write"</td>"
next
Response.Write"</tr></table>"
end if
end if
%> </center> <%
rootrs.Close
set rootrs=nothing
conn.close
set conn=nothing
%>
</BODY>
</HTML>
#7
<!-- #Include File="../inc/conn.asp" -->
<%
set rs=server.createobject("adodb.recordset")
qq="select count(ID) as t from AM_AssetClear where id='"+request("id")+"'"
rs.Open qq,conn,1,1
number=rs("t")
rs.Close
dim qq
dim t,m
desurl="Query_Clear.asp"
set rs=server.createobject("adodb.recordset")
if request("Value2")="" then
qq="select * from AM_AssetClear order by ID"
else
qq="select * from AM_AssetClear where ApplyUnits='"&request("Value2")&"' order by ID"
end if
rs.Open qq,conn,1,1
if not (rs.eof and rs.bof) then
pgsz=20
rs.pagesize=Cint(pgsz)
total=rs.pagecount
PageNo=request("pageno")
if pageno="" then pageno=1
scrollAction=request("scrollaction")
if scrollaction="first" then pageno=1
if scrollaction="pre" then pageno=pageno-1
if scrollaction="next" then pageno=pageno+1
if scrollaction="last" then pageno=total
if pageno<1 then pageno=1
if request("inputpage")<>"" then pageno=cint(request("inputpage"))
n=1
rs.absolutepage=pageno
position=rs.pagesize*pageno
pagebegin=position-rs.pagesize+1
if position<rs.recordcount then
pageend=position
else
pageend=rs.recordcount
end if
else
total=0
end if%>
<HTML><HEAD><TITLE>资产清理信息</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<LINK href="../oa.css" rel=stylesheet>
<script language="javascript">
function validate()
{
if ((document.search.inputpage.value > <%=total%>)||(document.search.inputpage.value < 1)) {alert('请输入正确的页数');return}
document.search.submit();
}
</script>
</HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0>
<%if request("Value2")<>"" then
set rs1=server.createobject("adodb.recordset")
qq="select UnitsName from HR_Units where ID='"&request("Value2")&"'"
rs1.open qq,cn,1,1
if not rs1.eof then
UnitsName=rs1("UnitsName")
else
UnitsName=""
end if
rs1.close
end if
%>
<p align="center"><b><font color="#800080"><%=UnitsName%>资产清理信息</font></b></p>
<form name="search" action="<%=desurl%>?number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>" method=post>
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" height="29">
<tr>
<td width="20%" height="1" class="n2" bgcolor="#ffffff" align="center" valign="middle" colspan="3">
共有<font color="ff0000" size="3"><% =rs.recordcount%></font>条 这是第<%=pagebegin%>-<% =pageend%>条
</td>
<td width="40%" bordercolor="#000099" height="1" align="center">
<%
if pageno>1 then%>
<a href="<%=desurl%>?scrollaction=first&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">首页</font></a>
<%response.write " "%>
<a href="<%=desurl%>?scrollaction=pre&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">上一页</font></a>
<%else
response.write "<font color='darkgray'>首页</font>"
response.write " "
response.write "<font color='darkgray'>上一页</font>"
end if
response.write " "
if rowcount=0 and pageno<>total then %>
<a href="<%=desurl%>?scrollaction=next&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">下一页</font></a>
<%response.write " "%>
<a href="<%=desurl%>?scrollaction=last&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">尾页</font></a>
<%else
response.write "<font color='darkgray'>下一页</font>"
response.write " "
response.write "<font color='darkgray'>尾页</font>"
end if
%>
</td>
<td width="20%" bordercolor="#000099" height="1" align="center">第<%=pageno%>/<%=total%>页</td>
<td width="20%" bordercolor="#000099" height="1" align="center">转到:<input type="text" name="inputpage" size="6" style="height: 20; width: 28" value="1" maxlen=3>页 <input style="height: 20; width: 35" type="button" value="Go" class=bc onclick="validate()"></td>
</tr>
</table>
</form>
<%
set rs=server.createobject("adodb.recordset")
qq="select count(ID) as t from AM_AssetClear where id='"+request("id")+"'"
rs.Open qq,conn,1,1
number=rs("t")
rs.Close
dim qq
dim t,m
desurl="Query_Clear.asp"
set rs=server.createobject("adodb.recordset")
if request("Value2")="" then
qq="select * from AM_AssetClear order by ID"
else
qq="select * from AM_AssetClear where ApplyUnits='"&request("Value2")&"' order by ID"
end if
rs.Open qq,conn,1,1
if not (rs.eof and rs.bof) then
pgsz=20
rs.pagesize=Cint(pgsz)
total=rs.pagecount
PageNo=request("pageno")
if pageno="" then pageno=1
scrollAction=request("scrollaction")
if scrollaction="first" then pageno=1
if scrollaction="pre" then pageno=pageno-1
if scrollaction="next" then pageno=pageno+1
if scrollaction="last" then pageno=total
if pageno<1 then pageno=1
if request("inputpage")<>"" then pageno=cint(request("inputpage"))
n=1
rs.absolutepage=pageno
position=rs.pagesize*pageno
pagebegin=position-rs.pagesize+1
if position<rs.recordcount then
pageend=position
else
pageend=rs.recordcount
end if
else
total=0
end if%>
<HTML><HEAD><TITLE>资产清理信息</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<LINK href="../oa.css" rel=stylesheet>
<script language="javascript">
function validate()
{
if ((document.search.inputpage.value > <%=total%>)||(document.search.inputpage.value < 1)) {alert('请输入正确的页数');return}
document.search.submit();
}
</script>
</HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0>
<%if request("Value2")<>"" then
set rs1=server.createobject("adodb.recordset")
qq="select UnitsName from HR_Units where ID='"&request("Value2")&"'"
rs1.open qq,cn,1,1
if not rs1.eof then
UnitsName=rs1("UnitsName")
else
UnitsName=""
end if
rs1.close
end if
%>
<p align="center"><b><font color="#800080"><%=UnitsName%>资产清理信息</font></b></p>
<form name="search" action="<%=desurl%>?number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>" method=post>
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" height="29">
<tr>
<td width="20%" height="1" class="n2" bgcolor="#ffffff" align="center" valign="middle" colspan="3">
共有<font color="ff0000" size="3"><% =rs.recordcount%></font>条 这是第<%=pagebegin%>-<% =pageend%>条
</td>
<td width="40%" bordercolor="#000099" height="1" align="center">
<%
if pageno>1 then%>
<a href="<%=desurl%>?scrollaction=first&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">首页</font></a>
<%response.write " "%>
<a href="<%=desurl%>?scrollaction=pre&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">上一页</font></a>
<%else
response.write "<font color='darkgray'>首页</font>"
response.write " "
response.write "<font color='darkgray'>上一页</font>"
end if
response.write " "
if rowcount=0 and pageno<>total then %>
<a href="<%=desurl%>?scrollaction=next&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">下一页</font></a>
<%response.write " "%>
<a href="<%=desurl%>?scrollaction=last&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">尾页</font></a>
<%else
response.write "<font color='darkgray'>下一页</font>"
response.write " "
response.write "<font color='darkgray'>尾页</font>"
end if
%>
</td>
<td width="20%" bordercolor="#000099" height="1" align="center">第<%=pageno%>/<%=total%>页</td>
<td width="20%" bordercolor="#000099" height="1" align="center">转到:<input type="text" name="inputpage" size="6" style="height: 20; width: 28" value="1" maxlen=3>页 <input style="height: 20; width: 35" type="button" value="Go" class=bc onclick="validate()"></td>
</tr>
</table>
</form>
#8
<%
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("/database/pldd.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
<html>
<head>
<title>测试信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
body,td,p{font-size:9pt}
a:link{font-size:9pt;color:#0000ff;text-decoration:underline}
a:visited{font-size:9pt;color:#0000ff;text-decoration:underline}
a:hover{font-size:9pt;color:#0000ff;text-decoration:none}
</style>
<script language="JavaScript">
<!--
function checkinput()
{
if (document.search.keyword.value=="")
{
alert(" 请输入想查询的产品名称!");
document.search.keyword.focus();
return false;
}
return true;
}
-->
</script>
</head>
<body bgcolor="#FFFFFF">
<%
const MaxPerPage=40
dim totalPut
dim keyword
dim category
dim CurrentPage
dim TotalPages
dim i
dim fsc
dim categoryid
keyword=trim(request("keyword"))
%>
<%
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
filename="gllist.asp"
dim sql
dim rs
sql="select * from gl where gl_order like '%"&keyword&"%' or gl_name like '%"&keyword&"%' order by gl_date desc,gl_order desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<p align='center'><font color='#FF0000' style='font-size:23pt'>非常对不起,暂时找不到信息!!</font><br><a href='javascript:history.back()' style='font-size:20pt'>返回</a></p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,filename
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,filename
else
currentPage=1
showContent
showpage totalput,MaxPerPage,filename
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
number=maxperpage*(currentpage-1)+1
dim i
i=0
%>
<center>
<form method="post" action="gllist.asp" name=document>
<p>请输入查询内容:<input type="text" name="keyword" size="20" maxlength="255" style="border-left: 1px solid #FFFFFF; border-right: 1px solid #FFFFFF;border-top: 1px solid #FFFFFF; border-bottom:1px solid rgb(0.0,0); font-family: "Courier", "Arial"; font-size: 9pt; color: #000000;background:#ffffff; font-weight: normal" onsubmit="return checkinput()">
<input type="submit" name="Submit" value="查询" style="border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000"> </p>
</form>
</center>
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="500"><b>关键字-->> <font color="#FF0000"><%=keyword%></b></td>
</tr>
</table>
<table border="1" cellspacing="1" cellpadding="3" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr>
<td width="100" bgcolor="#F0F0FF" align="center" height="20"><strong>出单日期</strong></font></td>
<td width="300" bgcolor="#F0F0FF" align="center"><strong>店名</trong></font></td>
<td width="70" bgcolor="#F0F0FF" align="center"><strong>发货单号</strong></font></td>
<td width="50" bgcolor="#F0F0FF" align="center"><strong>箱数</strong></font></td>
<td width="50" bgcolor="#F0F0FF" align="center"><strong>重量</strong></font></td>
</tr>
<%do while not rs.eof%>
<tr>
<td width="100" align="center" height="20"><%=rs("gl_date")%></td>
<td width="300"><%=rs("gl_name")%></td>
<td width="70" align="center"><%=rs("gl_order")%></a></td>
<td width="50" align="center"><%=rs("gl_pack")%></td>
<td width="50" align="center"><%=rs("gl_weight")%></td>
</tr>
<% i=i+1
number=number+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<p align=center><form method=Post action="&filename&"?keyword="&keyword&">"
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href="&filename&"?keyword="&keyword&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&keyword="&keyword&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&keyword="&keyword&">下一页</a> "
response.write " <a href="&filename&"?page="&n&"&keyword="&keyword&">尾页</a>"
end if
response.write " <font color=red>"&CurrentPage&"</font>/"&n&" 页 "
response.write " 总共 <font color=red><b>"&totalnumber&"</b></font> 单"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 value="¤tpage&" style='border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000'>"
response.write "<input type='submit' value='GoTo' name='cmdok' style='border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000'></span></p></form>"
end function
%>
</body>
</html>
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("/database/pldd.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
<html>
<head>
<title>测试信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
body,td,p{font-size:9pt}
a:link{font-size:9pt;color:#0000ff;text-decoration:underline}
a:visited{font-size:9pt;color:#0000ff;text-decoration:underline}
a:hover{font-size:9pt;color:#0000ff;text-decoration:none}
</style>
<script language="JavaScript">
<!--
function checkinput()
{
if (document.search.keyword.value=="")
{
alert(" 请输入想查询的产品名称!");
document.search.keyword.focus();
return false;
}
return true;
}
-->
</script>
</head>
<body bgcolor="#FFFFFF">
<%
const MaxPerPage=40
dim totalPut
dim keyword
dim category
dim CurrentPage
dim TotalPages
dim i
dim fsc
dim categoryid
keyword=trim(request("keyword"))
%>
<%
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
filename="gllist.asp"
dim sql
dim rs
sql="select * from gl where gl_order like '%"&keyword&"%' or gl_name like '%"&keyword&"%' order by gl_date desc,gl_order desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<p align='center'><font color='#FF0000' style='font-size:23pt'>非常对不起,暂时找不到信息!!</font><br><a href='javascript:history.back()' style='font-size:20pt'>返回</a></p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,filename
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,filename
else
currentPage=1
showContent
showpage totalput,MaxPerPage,filename
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
number=maxperpage*(currentpage-1)+1
dim i
i=0
%>
<center>
<form method="post" action="gllist.asp" name=document>
<p>请输入查询内容:<input type="text" name="keyword" size="20" maxlength="255" style="border-left: 1px solid #FFFFFF; border-right: 1px solid #FFFFFF;border-top: 1px solid #FFFFFF; border-bottom:1px solid rgb(0.0,0); font-family: "Courier", "Arial"; font-size: 9pt; color: #000000;background:#ffffff; font-weight: normal" onsubmit="return checkinput()">
<input type="submit" name="Submit" value="查询" style="border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000"> </p>
</form>
</center>
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="500"><b>关键字-->> <font color="#FF0000"><%=keyword%></b></td>
</tr>
</table>
<table border="1" cellspacing="1" cellpadding="3" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr>
<td width="100" bgcolor="#F0F0FF" align="center" height="20"><strong>出单日期</strong></font></td>
<td width="300" bgcolor="#F0F0FF" align="center"><strong>店名</trong></font></td>
<td width="70" bgcolor="#F0F0FF" align="center"><strong>发货单号</strong></font></td>
<td width="50" bgcolor="#F0F0FF" align="center"><strong>箱数</strong></font></td>
<td width="50" bgcolor="#F0F0FF" align="center"><strong>重量</strong></font></td>
</tr>
<%do while not rs.eof%>
<tr>
<td width="100" align="center" height="20"><%=rs("gl_date")%></td>
<td width="300"><%=rs("gl_name")%></td>
<td width="70" align="center"><%=rs("gl_order")%></a></td>
<td width="50" align="center"><%=rs("gl_pack")%></td>
<td width="50" align="center"><%=rs("gl_weight")%></td>
</tr>
<% i=i+1
number=number+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<p align=center><form method=Post action="&filename&"?keyword="&keyword&">"
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href="&filename&"?keyword="&keyword&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&keyword="&keyword&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&keyword="&keyword&">下一页</a> "
response.write " <a href="&filename&"?page="&n&"&keyword="&keyword&">尾页</a>"
end if
response.write " <font color=red>"&CurrentPage&"</font>/"&n&" 页 "
response.write " 总共 <font color=red><b>"&totalnumber&"</b></font> 单"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 value="¤tpage&" style='border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000'>"
response.write "<input type='submit' value='GoTo' name='cmdok' style='border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000'></span></p></form>"
end function
%>
</body>
</html>
#9
1.rs.pagesize=10
2.数据库连接,SQL语句全选
3.page传值
4.当前页记录显示
rs.absolutepage=page
for i = 1 to rs.pagesize
调用具体的字段集(=rs("字段名"))
if rs.eof then exit for
next
2.数据库连接,SQL语句全选
3.page传值
4.当前页记录显示
rs.absolutepage=page
for i = 1 to rs.pagesize
调用具体的字段集(=rs("字段名"))
if rs.eof then exit for
next
#10
找数据窗口呢?
你不如去学习。net吧,不要搞asp了,不管你是转方向还是赶工,我认为你现在的情况用。net开发要比asp快。
你不如去学习。net吧,不要搞asp了,不管你是转方向还是赶工,我认为你现在的情况用。net开发要比asp快。
#11
。net中有你熟悉的数据窗口(近似)
#1
使用存储过程分页!
#2
我是想要代码,不是要思想,谢谢
#3
或者例子
#4
<!--#include file="../include/sql.asp"-->
<!--#include file="../include/ubb.asp"-->
<!--#include file="../include/indexconn.asp"-->
<p align="center"><!--#include file="top1.asp" --></p>
<table width="760" align="center" cellpadding="0" cellspacing="0" class="table-zuoyou">
<tr>
<td width="170" height="350" valign="top" class="table-you">
</td>
<td height="350" valign="top">
<%
Call opendb(0)
If Request("Page")=Empty Then
Page=1
Else
Page=cint(Request("Page"))
End If
key=trim(Request("key"))
key=Replace(key, "'", "''")
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from TProductInfo where (Fs_PCode like '%" & key & "%' or Fs_Code like '%" & key & "%' or Fs_GoodsType like '%" & key & "%' or Fs_ProductType like '%" & key & "%' or Fs_ProductClass like '%" & key & "%' or Fs_Brand like '%" & key & "%' or Fs_Intro like '%" & key & "%' or Fs_Rem like '%" & key & "%') order by Fs_PCode"
rs.open sql,conn,1,1
if rs.eof then
response.write "<br>非常抱谦,未找到符合您搜索关键字的信息。"
end if
rs.pagesize = 20
if request("page")="" or isempty(request("page")) then
page = 1
else
page=int(request("page"))
end if
if page>rs.pagecount then
page=rs.pagecount
end if
if not rs.BOF then
Rs.Move Rs.PageSize*(page-1)
end if%> <br>
<table width="98%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"> 符合搜索关键字"<font color=#ff0000><%=key%></font>"的,共有<%=rs.RecordCount%>笔资料,每页显示<%=RS.PageSize%>笔,目前显示第<font color=#ff0000><%=page%></font>/<%=rs.pagecount%>页</td>
</tr>
</table>
<table width="98%" align="center" cellpadding="5" cellspacing="0" class="table-shang">
<%
i=1
do while not rs.eof and i<=rs.pagesize
%><tr>
<td width="120" height="100" align="center" valign="middle"><a href="/ProductInfo.asp?SerNo=<%=rs("Fs_PCode")%>" onFocus="this.blur()"><img src="<%=rs("Fs_Picture")%>" width="75" height="75" border="0"></a></td>
<td valign="top"><a href=/ProductInfo.asp?SerNo=<%=rs("Fs_PCode")%>>
<%mc=rs("Fs_Name")
If xz="mc" Then
mc=Replace(mc, key ,"<font color=#ff0000>"&key&"</font>")
end if
response.write mc%>
</a><br>
市场价:<s>¥<%=rs("Fd_MarketPrice")%>元</s> 中维价:¥<%=rs("Fd_MemberPrice")%>元<br>
简评:
<%jp=left(rs("Fs_Rem"),100)
If xz="jp" Then
jp=Replace(jp, key ,"<font color=#ff0000>"&key&"</font>")
end if
response.write jp%>
<br>
</td>
</tr><%
i=i+1
rs.MoveNext
loop
%>
</table>
<table width="98%" height="30" align="center" cellpadding="0" cellspacing="0">
<form name=form method=post action=?key=<%=request("key")%>>
<tr>
<td valign="bottom"> <%
if rs.recordcount<>0 then
if page-1 mod 10=0 then
p=(page-1) \ 10
else
p=(page-1) \ 10
end if
response.write " >>分页:"
if p*10>0 then response.write "<a href='?key="&request("key")&"&page="&p*10&"' title=上十页>[上十页]</a> "
uming_i=1
for ii=p*10+1 to P*10+10
if ii=page then
response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
else
response.write "<a href='?key="&request("key")&"&page="&ii&"'>["+Cstr(ii)+"]</a> "
end if
if ii=rs.pagecount then exit for
uming_i=uming_i+1
next
if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?key="&request("key")&"&page="&ii&" 'title=下十页>[下十页]</a> "
response.write(" 跳页:<input type=text name=page size=2 maxlength=3 class=wenbenkuang> <input type=submit name=Submit2 value=Go class=go-wenbenkuang>")
end if%> </td>
</tr>
</form>
</table></td>
</tr>
</table>
<!--#include file="../include/ubb.asp"-->
<!--#include file="../include/indexconn.asp"-->
<p align="center"><!--#include file="top1.asp" --></p>
<table width="760" align="center" cellpadding="0" cellspacing="0" class="table-zuoyou">
<tr>
<td width="170" height="350" valign="top" class="table-you">
</td>
<td height="350" valign="top">
<%
Call opendb(0)
If Request("Page")=Empty Then
Page=1
Else
Page=cint(Request("Page"))
End If
key=trim(Request("key"))
key=Replace(key, "'", "''")
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from TProductInfo where (Fs_PCode like '%" & key & "%' or Fs_Code like '%" & key & "%' or Fs_GoodsType like '%" & key & "%' or Fs_ProductType like '%" & key & "%' or Fs_ProductClass like '%" & key & "%' or Fs_Brand like '%" & key & "%' or Fs_Intro like '%" & key & "%' or Fs_Rem like '%" & key & "%') order by Fs_PCode"
rs.open sql,conn,1,1
if rs.eof then
response.write "<br>非常抱谦,未找到符合您搜索关键字的信息。"
end if
rs.pagesize = 20
if request("page")="" or isempty(request("page")) then
page = 1
else
page=int(request("page"))
end if
if page>rs.pagecount then
page=rs.pagecount
end if
if not rs.BOF then
Rs.Move Rs.PageSize*(page-1)
end if%> <br>
<table width="98%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"> 符合搜索关键字"<font color=#ff0000><%=key%></font>"的,共有<%=rs.RecordCount%>笔资料,每页显示<%=RS.PageSize%>笔,目前显示第<font color=#ff0000><%=page%></font>/<%=rs.pagecount%>页</td>
</tr>
</table>
<table width="98%" align="center" cellpadding="5" cellspacing="0" class="table-shang">
<%
i=1
do while not rs.eof and i<=rs.pagesize
%><tr>
<td width="120" height="100" align="center" valign="middle"><a href="/ProductInfo.asp?SerNo=<%=rs("Fs_PCode")%>" onFocus="this.blur()"><img src="<%=rs("Fs_Picture")%>" width="75" height="75" border="0"></a></td>
<td valign="top"><a href=/ProductInfo.asp?SerNo=<%=rs("Fs_PCode")%>>
<%mc=rs("Fs_Name")
If xz="mc" Then
mc=Replace(mc, key ,"<font color=#ff0000>"&key&"</font>")
end if
response.write mc%>
</a><br>
市场价:<s>¥<%=rs("Fd_MarketPrice")%>元</s> 中维价:¥<%=rs("Fd_MemberPrice")%>元<br>
简评:
<%jp=left(rs("Fs_Rem"),100)
If xz="jp" Then
jp=Replace(jp, key ,"<font color=#ff0000>"&key&"</font>")
end if
response.write jp%>
<br>
</td>
</tr><%
i=i+1
rs.MoveNext
loop
%>
</table>
<table width="98%" height="30" align="center" cellpadding="0" cellspacing="0">
<form name=form method=post action=?key=<%=request("key")%>>
<tr>
<td valign="bottom"> <%
if rs.recordcount<>0 then
if page-1 mod 10=0 then
p=(page-1) \ 10
else
p=(page-1) \ 10
end if
response.write " >>分页:"
if p*10>0 then response.write "<a href='?key="&request("key")&"&page="&p*10&"' title=上十页>[上十页]</a> "
uming_i=1
for ii=p*10+1 to P*10+10
if ii=page then
response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
else
response.write "<a href='?key="&request("key")&"&page="&ii&"'>["+Cstr(ii)+"]</a> "
end if
if ii=rs.pagecount then exit for
uming_i=uming_i+1
next
if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?key="&request("key")&"&page="&ii&" 'title=下十页>[下十页]</a> "
response.write(" 跳页:<input type=text name=page size=2 maxlength=3 class=wenbenkuang> <input type=submit name=Submit2 value=Go class=go-wenbenkuang>")
end if%> </td>
</tr>
</form>
</table></td>
</tr>
</table>
#5
只需要传入搜索关键字 key
#6
很久以前写的代码,慢慢研读吧
vew.asp程序
主要功能:
在登录窗口中正确输入用户名和密码,或者通过成功注册新用户并单击“登录论坛”
超链接均可进入论坛窗口。在论坛窗口中,显示各用户名、发表的文章题目、有几人回复及文章内容的超链接。在显示这些内容时,主要参考使用了ASP的分页技术。点击文章内容的链接,进入相应的内容窗口。此外,本窗口还包括另外三个链接,其中,点击“我要发言”进入发言窗口,点击“离开论坛”进入离开论坛窗口,点击“管理员入口”进入管理员登录窗口。
①分页:本程序中的分页主要应用RecordSet对象的AbsolutePage、PageCount、PageSize等属性。当指定了PageSize属性后,对AbsolutePage指定值就可以翻转到指定的页面。程序如下:
<%@ Language=VBScript %>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=d:\DBbbs\BBS.mdb"
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY BGCOLOR="#EBEEF3">
<P> <TABLE width="90%" > <TR align=center> <TD> <a href="wordadd1.asp?no=<%Response.write request("no")%>">我要发言</a>
</TD><TD> <a href="leave.asp?no=<%Response.write request("no")%>">离开论坛</a> </TD><TD>
<a href="adminlogin.asp">管理员入口</a> </TD></TR> </TABLE></P> <%
sql="select * from 发言表 where 发言次序=1 order by id desc"
dim rootrs
set rootrs=server.CreateObject("adodb.recordset")
rootrs.Open sql,conn,1,1
if rootrs.BOF or rootrs.EOF then
Response.Write"目前还没有发言内容."
else
set name1=rootrs("发言标题")
set name2=rootrs("用户名")
set name3=rootrs("回复数")
set name4=rootrs("电子信箱")
set num=rootrs("num")
rootrs.PageSize=10
rootrs.AbsolutePage=1
if request("page")<>"" then
rootrs.AbsolutePage=request("page")
end if
rowcount=rootrs.pagesize
%> <center> <%
if not rootrs.eof then
%> <p> <table border="1" cellspacing="0" width="650" height="20" bgcolor="#fdbd6f" cellpadding="4">
<%
do while not rootrs.EOF and rowcount>0
%> <tr> <td width=95 valign=top> <font color=blue><a href="mailto:<%response.write name4%>"><%Response.Write name2%></a></font>
</td><td width=295 valign=top> <font color=darked><%Response.Write name1%></font>
</td><td width=95 valign=top> <font color=darked><%Response.Write name3%>人回复</font>
</td><td width=145 valign=top> <a href="vew2.asp?num=<%=num%>&no=<%Response.write""&request("no")&""%>">言论内容</a></font>
</td></tr> <%
rootrs.MoveNext
rowcount=rowcount-1
loop
end if
if rootrs.PageCount>1 then
Response.Write"<table border=0>"
Response.write"<tr>"
Response.Write"<td><b>帖子分页:</b></td>"
for i=1 to rootrs.PageCount
Response.Write"<td><a href='vew.asp?page="&i&"&no="&request("no")&"'>"
Response.Write"[<b>"&i&"</b>]</a>"
Response.Write"</td>"
next
Response.Write"</tr></table>"
end if
end if
%> </center> <%
rootrs.Close
set rootrs=nothing
conn.close
set conn=nothing
%>
</BODY>
</HTML>
vew.asp程序
主要功能:
在登录窗口中正确输入用户名和密码,或者通过成功注册新用户并单击“登录论坛”
超链接均可进入论坛窗口。在论坛窗口中,显示各用户名、发表的文章题目、有几人回复及文章内容的超链接。在显示这些内容时,主要参考使用了ASP的分页技术。点击文章内容的链接,进入相应的内容窗口。此外,本窗口还包括另外三个链接,其中,点击“我要发言”进入发言窗口,点击“离开论坛”进入离开论坛窗口,点击“管理员入口”进入管理员登录窗口。
①分页:本程序中的分页主要应用RecordSet对象的AbsolutePage、PageCount、PageSize等属性。当指定了PageSize属性后,对AbsolutePage指定值就可以翻转到指定的页面。程序如下:
<%@ Language=VBScript %>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=d:\DBbbs\BBS.mdb"
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY BGCOLOR="#EBEEF3">
<P> <TABLE width="90%" > <TR align=center> <TD> <a href="wordadd1.asp?no=<%Response.write request("no")%>">我要发言</a>
</TD><TD> <a href="leave.asp?no=<%Response.write request("no")%>">离开论坛</a> </TD><TD>
<a href="adminlogin.asp">管理员入口</a> </TD></TR> </TABLE></P> <%
sql="select * from 发言表 where 发言次序=1 order by id desc"
dim rootrs
set rootrs=server.CreateObject("adodb.recordset")
rootrs.Open sql,conn,1,1
if rootrs.BOF or rootrs.EOF then
Response.Write"目前还没有发言内容."
else
set name1=rootrs("发言标题")
set name2=rootrs("用户名")
set name3=rootrs("回复数")
set name4=rootrs("电子信箱")
set num=rootrs("num")
rootrs.PageSize=10
rootrs.AbsolutePage=1
if request("page")<>"" then
rootrs.AbsolutePage=request("page")
end if
rowcount=rootrs.pagesize
%> <center> <%
if not rootrs.eof then
%> <p> <table border="1" cellspacing="0" width="650" height="20" bgcolor="#fdbd6f" cellpadding="4">
<%
do while not rootrs.EOF and rowcount>0
%> <tr> <td width=95 valign=top> <font color=blue><a href="mailto:<%response.write name4%>"><%Response.Write name2%></a></font>
</td><td width=295 valign=top> <font color=darked><%Response.Write name1%></font>
</td><td width=95 valign=top> <font color=darked><%Response.Write name3%>人回复</font>
</td><td width=145 valign=top> <a href="vew2.asp?num=<%=num%>&no=<%Response.write""&request("no")&""%>">言论内容</a></font>
</td></tr> <%
rootrs.MoveNext
rowcount=rowcount-1
loop
end if
if rootrs.PageCount>1 then
Response.Write"<table border=0>"
Response.write"<tr>"
Response.Write"<td><b>帖子分页:</b></td>"
for i=1 to rootrs.PageCount
Response.Write"<td><a href='vew.asp?page="&i&"&no="&request("no")&"'>"
Response.Write"[<b>"&i&"</b>]</a>"
Response.Write"</td>"
next
Response.Write"</tr></table>"
end if
end if
%> </center> <%
rootrs.Close
set rootrs=nothing
conn.close
set conn=nothing
%>
</BODY>
</HTML>
#7
<!-- #Include File="../inc/conn.asp" -->
<%
set rs=server.createobject("adodb.recordset")
qq="select count(ID) as t from AM_AssetClear where id='"+request("id")+"'"
rs.Open qq,conn,1,1
number=rs("t")
rs.Close
dim qq
dim t,m
desurl="Query_Clear.asp"
set rs=server.createobject("adodb.recordset")
if request("Value2")="" then
qq="select * from AM_AssetClear order by ID"
else
qq="select * from AM_AssetClear where ApplyUnits='"&request("Value2")&"' order by ID"
end if
rs.Open qq,conn,1,1
if not (rs.eof and rs.bof) then
pgsz=20
rs.pagesize=Cint(pgsz)
total=rs.pagecount
PageNo=request("pageno")
if pageno="" then pageno=1
scrollAction=request("scrollaction")
if scrollaction="first" then pageno=1
if scrollaction="pre" then pageno=pageno-1
if scrollaction="next" then pageno=pageno+1
if scrollaction="last" then pageno=total
if pageno<1 then pageno=1
if request("inputpage")<>"" then pageno=cint(request("inputpage"))
n=1
rs.absolutepage=pageno
position=rs.pagesize*pageno
pagebegin=position-rs.pagesize+1
if position<rs.recordcount then
pageend=position
else
pageend=rs.recordcount
end if
else
total=0
end if%>
<HTML><HEAD><TITLE>资产清理信息</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<LINK href="../oa.css" rel=stylesheet>
<script language="javascript">
function validate()
{
if ((document.search.inputpage.value > <%=total%>)||(document.search.inputpage.value < 1)) {alert('请输入正确的页数');return}
document.search.submit();
}
</script>
</HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0>
<%if request("Value2")<>"" then
set rs1=server.createobject("adodb.recordset")
qq="select UnitsName from HR_Units where ID='"&request("Value2")&"'"
rs1.open qq,cn,1,1
if not rs1.eof then
UnitsName=rs1("UnitsName")
else
UnitsName=""
end if
rs1.close
end if
%>
<p align="center"><b><font color="#800080"><%=UnitsName%>资产清理信息</font></b></p>
<form name="search" action="<%=desurl%>?number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>" method=post>
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" height="29">
<tr>
<td width="20%" height="1" class="n2" bgcolor="#ffffff" align="center" valign="middle" colspan="3">
共有<font color="ff0000" size="3"><% =rs.recordcount%></font>条 这是第<%=pagebegin%>-<% =pageend%>条
</td>
<td width="40%" bordercolor="#000099" height="1" align="center">
<%
if pageno>1 then%>
<a href="<%=desurl%>?scrollaction=first&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">首页</font></a>
<%response.write " "%>
<a href="<%=desurl%>?scrollaction=pre&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">上一页</font></a>
<%else
response.write "<font color='darkgray'>首页</font>"
response.write " "
response.write "<font color='darkgray'>上一页</font>"
end if
response.write " "
if rowcount=0 and pageno<>total then %>
<a href="<%=desurl%>?scrollaction=next&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">下一页</font></a>
<%response.write " "%>
<a href="<%=desurl%>?scrollaction=last&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">尾页</font></a>
<%else
response.write "<font color='darkgray'>下一页</font>"
response.write " "
response.write "<font color='darkgray'>尾页</font>"
end if
%>
</td>
<td width="20%" bordercolor="#000099" height="1" align="center">第<%=pageno%>/<%=total%>页</td>
<td width="20%" bordercolor="#000099" height="1" align="center">转到:<input type="text" name="inputpage" size="6" style="height: 20; width: 28" value="1" maxlen=3>页 <input style="height: 20; width: 35" type="button" value="Go" class=bc onclick="validate()"></td>
</tr>
</table>
</form>
<%
set rs=server.createobject("adodb.recordset")
qq="select count(ID) as t from AM_AssetClear where id='"+request("id")+"'"
rs.Open qq,conn,1,1
number=rs("t")
rs.Close
dim qq
dim t,m
desurl="Query_Clear.asp"
set rs=server.createobject("adodb.recordset")
if request("Value2")="" then
qq="select * from AM_AssetClear order by ID"
else
qq="select * from AM_AssetClear where ApplyUnits='"&request("Value2")&"' order by ID"
end if
rs.Open qq,conn,1,1
if not (rs.eof and rs.bof) then
pgsz=20
rs.pagesize=Cint(pgsz)
total=rs.pagecount
PageNo=request("pageno")
if pageno="" then pageno=1
scrollAction=request("scrollaction")
if scrollaction="first" then pageno=1
if scrollaction="pre" then pageno=pageno-1
if scrollaction="next" then pageno=pageno+1
if scrollaction="last" then pageno=total
if pageno<1 then pageno=1
if request("inputpage")<>"" then pageno=cint(request("inputpage"))
n=1
rs.absolutepage=pageno
position=rs.pagesize*pageno
pagebegin=position-rs.pagesize+1
if position<rs.recordcount then
pageend=position
else
pageend=rs.recordcount
end if
else
total=0
end if%>
<HTML><HEAD><TITLE>资产清理信息</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<LINK href="../oa.css" rel=stylesheet>
<script language="javascript">
function validate()
{
if ((document.search.inputpage.value > <%=total%>)||(document.search.inputpage.value < 1)) {alert('请输入正确的页数');return}
document.search.submit();
}
</script>
</HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0>
<%if request("Value2")<>"" then
set rs1=server.createobject("adodb.recordset")
qq="select UnitsName from HR_Units where ID='"&request("Value2")&"'"
rs1.open qq,cn,1,1
if not rs1.eof then
UnitsName=rs1("UnitsName")
else
UnitsName=""
end if
rs1.close
end if
%>
<p align="center"><b><font color="#800080"><%=UnitsName%>资产清理信息</font></b></p>
<form name="search" action="<%=desurl%>?number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>" method=post>
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" height="29">
<tr>
<td width="20%" height="1" class="n2" bgcolor="#ffffff" align="center" valign="middle" colspan="3">
共有<font color="ff0000" size="3"><% =rs.recordcount%></font>条 这是第<%=pagebegin%>-<% =pageend%>条
</td>
<td width="40%" bordercolor="#000099" height="1" align="center">
<%
if pageno>1 then%>
<a href="<%=desurl%>?scrollaction=first&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">首页</font></a>
<%response.write " "%>
<a href="<%=desurl%>?scrollaction=pre&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">上一页</font></a>
<%else
response.write "<font color='darkgray'>首页</font>"
response.write " "
response.write "<font color='darkgray'>上一页</font>"
end if
response.write " "
if rowcount=0 and pageno<>total then %>
<a href="<%=desurl%>?scrollaction=next&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">下一页</font></a>
<%response.write " "%>
<a href="<%=desurl%>?scrollaction=last&pageno=<% =pageno%>&number=<% =t%>&Value2=<% if request("Value2")<>"" then response.write request("Value2") else response.write ""%>&ApplyUnits=<% =request("Value2")%>"><font color="000099">尾页</font></a>
<%else
response.write "<font color='darkgray'>下一页</font>"
response.write " "
response.write "<font color='darkgray'>尾页</font>"
end if
%>
</td>
<td width="20%" bordercolor="#000099" height="1" align="center">第<%=pageno%>/<%=total%>页</td>
<td width="20%" bordercolor="#000099" height="1" align="center">转到:<input type="text" name="inputpage" size="6" style="height: 20; width: 28" value="1" maxlen=3>页 <input style="height: 20; width: 35" type="button" value="Go" class=bc onclick="validate()"></td>
</tr>
</table>
</form>
#8
<%
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("/database/pldd.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
<html>
<head>
<title>测试信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
body,td,p{font-size:9pt}
a:link{font-size:9pt;color:#0000ff;text-decoration:underline}
a:visited{font-size:9pt;color:#0000ff;text-decoration:underline}
a:hover{font-size:9pt;color:#0000ff;text-decoration:none}
</style>
<script language="JavaScript">
<!--
function checkinput()
{
if (document.search.keyword.value=="")
{
alert(" 请输入想查询的产品名称!");
document.search.keyword.focus();
return false;
}
return true;
}
-->
</script>
</head>
<body bgcolor="#FFFFFF">
<%
const MaxPerPage=40
dim totalPut
dim keyword
dim category
dim CurrentPage
dim TotalPages
dim i
dim fsc
dim categoryid
keyword=trim(request("keyword"))
%>
<%
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
filename="gllist.asp"
dim sql
dim rs
sql="select * from gl where gl_order like '%"&keyword&"%' or gl_name like '%"&keyword&"%' order by gl_date desc,gl_order desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<p align='center'><font color='#FF0000' style='font-size:23pt'>非常对不起,暂时找不到信息!!</font><br><a href='javascript:history.back()' style='font-size:20pt'>返回</a></p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,filename
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,filename
else
currentPage=1
showContent
showpage totalput,MaxPerPage,filename
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
number=maxperpage*(currentpage-1)+1
dim i
i=0
%>
<center>
<form method="post" action="gllist.asp" name=document>
<p>请输入查询内容:<input type="text" name="keyword" size="20" maxlength="255" style="border-left: 1px solid #FFFFFF; border-right: 1px solid #FFFFFF;border-top: 1px solid #FFFFFF; border-bottom:1px solid rgb(0.0,0); font-family: "Courier", "Arial"; font-size: 9pt; color: #000000;background:#ffffff; font-weight: normal" onsubmit="return checkinput()">
<input type="submit" name="Submit" value="查询" style="border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000"> </p>
</form>
</center>
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="500"><b>关键字-->> <font color="#FF0000"><%=keyword%></b></td>
</tr>
</table>
<table border="1" cellspacing="1" cellpadding="3" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr>
<td width="100" bgcolor="#F0F0FF" align="center" height="20"><strong>出单日期</strong></font></td>
<td width="300" bgcolor="#F0F0FF" align="center"><strong>店名</trong></font></td>
<td width="70" bgcolor="#F0F0FF" align="center"><strong>发货单号</strong></font></td>
<td width="50" bgcolor="#F0F0FF" align="center"><strong>箱数</strong></font></td>
<td width="50" bgcolor="#F0F0FF" align="center"><strong>重量</strong></font></td>
</tr>
<%do while not rs.eof%>
<tr>
<td width="100" align="center" height="20"><%=rs("gl_date")%></td>
<td width="300"><%=rs("gl_name")%></td>
<td width="70" align="center"><%=rs("gl_order")%></a></td>
<td width="50" align="center"><%=rs("gl_pack")%></td>
<td width="50" align="center"><%=rs("gl_weight")%></td>
</tr>
<% i=i+1
number=number+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<p align=center><form method=Post action="&filename&"?keyword="&keyword&">"
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href="&filename&"?keyword="&keyword&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&keyword="&keyword&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&keyword="&keyword&">下一页</a> "
response.write " <a href="&filename&"?page="&n&"&keyword="&keyword&">尾页</a>"
end if
response.write " <font color=red>"&CurrentPage&"</font>/"&n&" 页 "
response.write " 总共 <font color=red><b>"&totalnumber&"</b></font> 单"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 value="¤tpage&" style='border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000'>"
response.write "<input type='submit' value='GoTo' name='cmdok' style='border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000'></span></p></form>"
end function
%>
</body>
</html>
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("/database/pldd.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
<html>
<head>
<title>测试信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
body,td,p{font-size:9pt}
a:link{font-size:9pt;color:#0000ff;text-decoration:underline}
a:visited{font-size:9pt;color:#0000ff;text-decoration:underline}
a:hover{font-size:9pt;color:#0000ff;text-decoration:none}
</style>
<script language="JavaScript">
<!--
function checkinput()
{
if (document.search.keyword.value=="")
{
alert(" 请输入想查询的产品名称!");
document.search.keyword.focus();
return false;
}
return true;
}
-->
</script>
</head>
<body bgcolor="#FFFFFF">
<%
const MaxPerPage=40
dim totalPut
dim keyword
dim category
dim CurrentPage
dim TotalPages
dim i
dim fsc
dim categoryid
keyword=trim(request("keyword"))
%>
<%
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
filename="gllist.asp"
dim sql
dim rs
sql="select * from gl where gl_order like '%"&keyword&"%' or gl_name like '%"&keyword&"%' order by gl_date desc,gl_order desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<p align='center'><font color='#FF0000' style='font-size:23pt'>非常对不起,暂时找不到信息!!</font><br><a href='javascript:history.back()' style='font-size:20pt'>返回</a></p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,filename
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,filename
else
currentPage=1
showContent
showpage totalput,MaxPerPage,filename
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
number=maxperpage*(currentpage-1)+1
dim i
i=0
%>
<center>
<form method="post" action="gllist.asp" name=document>
<p>请输入查询内容:<input type="text" name="keyword" size="20" maxlength="255" style="border-left: 1px solid #FFFFFF; border-right: 1px solid #FFFFFF;border-top: 1px solid #FFFFFF; border-bottom:1px solid rgb(0.0,0); font-family: "Courier", "Arial"; font-size: 9pt; color: #000000;background:#ffffff; font-weight: normal" onsubmit="return checkinput()">
<input type="submit" name="Submit" value="查询" style="border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000"> </p>
</form>
</center>
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="500"><b>关键字-->> <font color="#FF0000"><%=keyword%></b></td>
</tr>
</table>
<table border="1" cellspacing="1" cellpadding="3" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr>
<td width="100" bgcolor="#F0F0FF" align="center" height="20"><strong>出单日期</strong></font></td>
<td width="300" bgcolor="#F0F0FF" align="center"><strong>店名</trong></font></td>
<td width="70" bgcolor="#F0F0FF" align="center"><strong>发货单号</strong></font></td>
<td width="50" bgcolor="#F0F0FF" align="center"><strong>箱数</strong></font></td>
<td width="50" bgcolor="#F0F0FF" align="center"><strong>重量</strong></font></td>
</tr>
<%do while not rs.eof%>
<tr>
<td width="100" align="center" height="20"><%=rs("gl_date")%></td>
<td width="300"><%=rs("gl_name")%></td>
<td width="70" align="center"><%=rs("gl_order")%></a></td>
<td width="50" align="center"><%=rs("gl_pack")%></td>
<td width="50" align="center"><%=rs("gl_weight")%></td>
</tr>
<% i=i+1
number=number+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<p align=center><form method=Post action="&filename&"?keyword="&keyword&">"
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href="&filename&"?keyword="&keyword&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&keyword="&keyword&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&keyword="&keyword&">下一页</a> "
response.write " <a href="&filename&"?page="&n&"&keyword="&keyword&">尾页</a>"
end if
response.write " <font color=red>"&CurrentPage&"</font>/"&n&" 页 "
response.write " 总共 <font color=red><b>"&totalnumber&"</b></font> 单"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 value="¤tpage&" style='border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000'>"
response.write "<input type='submit' value='GoTo' name='cmdok' style='border-left: 1px solid #000000; border-right: 1px solid #000000;border-top: 1px solid #000000; border-bottom:1px solid #000000;font-size:9pt;background-color: #FFFFFF;color:#000000'></span></p></form>"
end function
%>
</body>
</html>
#9
1.rs.pagesize=10
2.数据库连接,SQL语句全选
3.page传值
4.当前页记录显示
rs.absolutepage=page
for i = 1 to rs.pagesize
调用具体的字段集(=rs("字段名"))
if rs.eof then exit for
next
2.数据库连接,SQL语句全选
3.page传值
4.当前页记录显示
rs.absolutepage=page
for i = 1 to rs.pagesize
调用具体的字段集(=rs("字段名"))
if rs.eof then exit for
next
#10
找数据窗口呢?
你不如去学习。net吧,不要搞asp了,不管你是转方向还是赶工,我认为你现在的情况用。net开发要比asp快。
你不如去学习。net吧,不要搞asp了,不管你是转方向还是赶工,我认为你现在的情况用。net开发要比asp快。
#11
。net中有你熟悉的数据窗口(近似)