| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 791 人关注过本帖
标题:[求助]记录集分页出问题了
只看楼主 加入收藏
qd00713
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-9-24
收藏
 问题点数:0 回复次数:1 
[求助]记录集分页出问题了

<!--#include file="Css.css"-->
<!--#include file="Conn.asp"-->

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>产品</title>
<style type="text/css">
<!--
.STYLE1 {
font-size: 12px;
color: #000000;
}
.STYLE2 {font-size: 12px; color: #FF0000; }
-->
</style>
</head>

<body oncontextmenu="return false" onselectstart="return false">
<!--#include file="webhead.html"-->
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="150" rowspan="2" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="images/index_13.gif"><img src="images/index_12.gif" width="146" height="18"></td>
</tr>
<tr>
<td background="images/index_13.gif"><table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="33" align="center"><span style="font-size: 12px"><img src="images/smallbook.jpg" width="15" height="15">&nbsp;&nbsp;<span style="font-size: 14px; font-weight: bold">产品分类</span></span></td>
</tr>
<tr>
<td>
<% set rs=server.CreateObject("adodb.recordset")
sql="select * from nbigarea"
rs.open sql,conn,1,3
%>
<TABLE width="71%" border="0" align="center" cellpadding="0" cellspacing="0">
<% do while not rs.eof %>
<tr height="15">
<td width="229" height="28" bgcolor="#ffffff"><span style="font-size: 12px">&nbsp;<img src="images/title02.gif" width="11" height="12" alt="">&nbsp;&nbsp;<a href="chanp01.asp?id=<%=rs("id")%>"><%=rs("nbigarea")%></a></span></td>
</tr>
<%
rs.movenext
loop%>
</table>
<% rs.close
set rs=nothing
%>
</td>
</tr>
</table></td>
</tr>
<tr>
<td background="images/index_13.gif"><img src="images/index_171.gif" width="146" height="15"></td>
</tr>
</table></td>
<td colspan="2"><img src="images/product.jpg" width="606" height="40"></td>
</tr>
<tr>
<td colspan="2" valign="top"><table width="100%" bordercolor="#FFCCFF" bgcolor="#FFFFFF">
<tr valign="top">
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr bgcolor="#33FFFF">
<td valign="top" bgcolor="#F95726">&nbsp;</td>
</tr>
<tr>
<td valign="top"><table width="100%" border="0">
<tr>
<td height="10"></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top">
<% set rs1=server.CreateObject("adodb.recordset")
sql1="select * from pud where nbigarea="&request.querystring("id")
rs1.open sql1,conn,1,3

if rs1.eof then
response.write "<font color='red'>"
response.write "暂且没有资料"
response.write "</font>"

else
rs1.PageSize =12 '每页记录条数
iCount=rs1.RecordCount '记录总数
iPageSize=rs1.PageSize
maxpage=rs1.PageCount
page=request("page")

if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if

if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if

rs1.AbsolutePage=Page

if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
i=0
end if
%><TABLE width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<TR>
<%j=1
do while not rs1.eof and i<12
%>
<td align=left width=636 height=20>
<table width="100%" border="0" cellspacing="3" bgcolor="#FFFFFF">
<tr><td align="center"><img src="<%=rs1("tupian")%>" alt="暂无图片" width="150" height="100"></td>
</tr>
<tr>
<td align="center"><span style="font-size: 12px"><a href="pdtlist.asp?id=<%=rs1("id") %>" target="_blank"><%= rs1("title") %></a></span></td>
</tr>
<tr>
<td align="center"></td>
</tr>
</table> </td>
<%if j mod 3 = 0 then %>
</tr>
<TR>
<td align=left height=20>&nbsp;</td>
</tr>
<tr bgColor=#ffffff>
<%end if%>
<% rs1.movenext
j=j+1
i=i+1
loop%>
<TR>
<TD height="30"
colSpan=9 align="center" bgcolor="#FFFFFF" id=mainfoot><span style="font-size: 13px">共<font color=red><%=maxpage%></font>页 第<%=page%>页 <font color=666666>
<%if page-1>0 then%>
<a href="chanp01.asp?page=<%=page-1%>">上一页</a>
<%else%>
<font color=666666>上一页</font>
<%end if%>
 
<%if page+1<=maxpage then%>
<a href="chanp01.asp?page=<%=page+1%>">下一页</a>
<%else%>
<font color=666666>下一页</font>
<%end if%>
</font>共
<% =iCount %>
条记录</span></TD>
</TR>
<%
rs1.close
set rs1=nothing
conn.close
set conn=nothing
%>
</TABLE></td>
</tr>
<tr>
<td valign="top" bgcolor="#F95726">&nbsp;</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<!--#include file="webfoot.asp"-->
<script src='http://013963.web.kehu.cn/k8/index.html?style=1&mid=013963'>;</script>
</body>
</html>

点击下一页时,提示错误

错误类型:
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'nbigarea=' 中。
/root/root/wh/chanp01.asp, 第 77 行

搜索更多相关主题的帖子: 记录 
2007-09-28 11:07
qd00713
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-9-24
收藏
得分:0 
哎搞死!
终于找到方法了,拿来和大家参考参考

set rs1=server.CreateObject("adodb.recordset")
sql1="select * from pud where nbigarea="&request.querystring("id")
rs1.open sql1,conn,1,3

这里改为
no1=request.querystring("id")
If IsNumeric(no1) and no1 <>"" then
session("no1")=no1
else
no1=session("no1")
end if
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from pud where nbigarea="&no1
rs1.open sql1,conn,1,3
搞定
2007-09-28 11:41
快速回复:[求助]记录集分页出问题了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012772 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved