asp 分页 报错 Microsoft VBScript 运行时错误 错误 '800a01f5' 非法赋值: 'page'
setcon=server.createobject("ADODB.connection")sqlcon="Provider=Microsoft.Jet.OLEDB.4....
set con = server.createobject("ADODB.connection")
sqlcon ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &server.mappath("/Data/Data.mdb")
con.open(sqlcon)
set rs = server.createobject("adodb.recordset")
rs.cursortype = adopenstatic
sql="SELECT xinxitu, FenLeiNeiRong,xinxibiaoti,fenleisuoshuid from fenlei as f , xinxi as x where f.fenleiid=x.FenLeiId and fenleisuoshuid in (select fenleiid from fenlei where fenleisuoshuid = "&cid&") and fenleihao=1"
rs.PageSize = 4 '这里设定每页显示的记录数
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>
<%If not rs.EOF then%>
<%
i=1
For intLoop = 1 To rs.PageSize
If Not rs.EOF Then
%>
<table border="0" width="650px" height="100px" id="table1" >
<tr>
<td rowspan="2" width="170px" height="100px" align="center" valign="middle"><a href="works.asp?fid=<%= rs("fenleisuoshuid")%>" class="div-1" onMouseOut="this.className='div-1'" onMouseOver="this.className='div-2'"><img src="<%=rs("xinxitu") %>" width="130" height="100" border="0"></a></td>
<td width="480px" height="15px" align="left" valign="bottom"><a href="works.asp?fid=<%= rs("fenleisuoshuid")%>" style="color: #666666; font-size:10pt; font:黑体; text-decoration: none;"><strong><%=rs("xinxibiaoti")%></strong></a></td>
</tr>
<tr>
<td width="480px" height="85px" align="left" valign="top">
<%
if len (rs("FenLeiNeiRong")) >110 then '判断字符串的长度
response.Write left(rs("FenLeiNeiRong"),110)&".."
else
response.write rs("FenLeiNeiRong")
end if
%>
</td>
</tr>
</table>
<%
rs.MoveNext
End If
Next
else
response.Write "<div align=center></div>"
%>
<%End if%>
用马甲 把问题 写全了 加上一楼的 是 完整 问题 请高手 指点!
出错行 : page = trim(Request.QueryString("page")) 展开
sqlcon ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &server.mappath("/Data/Data.mdb")
con.open(sqlcon)
set rs = server.createobject("adodb.recordset")
rs.cursortype = adopenstatic
sql="SELECT xinxitu, FenLeiNeiRong,xinxibiaoti,fenleisuoshuid from fenlei as f , xinxi as x where f.fenleiid=x.FenLeiId and fenleisuoshuid in (select fenleiid from fenlei where fenleisuoshuid = "&cid&") and fenleihao=1"
rs.PageSize = 4 '这里设定每页显示的记录数
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>
<%If not rs.EOF then%>
<%
i=1
For intLoop = 1 To rs.PageSize
If Not rs.EOF Then
%>
<table border="0" width="650px" height="100px" id="table1" >
<tr>
<td rowspan="2" width="170px" height="100px" align="center" valign="middle"><a href="works.asp?fid=<%= rs("fenleisuoshuid")%>" class="div-1" onMouseOut="this.className='div-1'" onMouseOver="this.className='div-2'"><img src="<%=rs("xinxitu") %>" width="130" height="100" border="0"></a></td>
<td width="480px" height="15px" align="left" valign="bottom"><a href="works.asp?fid=<%= rs("fenleisuoshuid")%>" style="color: #666666; font-size:10pt; font:黑体; text-decoration: none;"><strong><%=rs("xinxibiaoti")%></strong></a></td>
</tr>
<tr>
<td width="480px" height="85px" align="left" valign="top">
<%
if len (rs("FenLeiNeiRong")) >110 then '判断字符串的长度
response.Write left(rs("FenLeiNeiRong"),110)&".."
else
response.write rs("FenLeiNeiRong")
end if
%>
</td>
</tr>
</table>
<%
rs.MoveNext
End If
Next
else
response.Write "<div align=center></div>"
%>
<%End if%>
用马甲 把问题 写全了 加上一楼的 是 完整 问题 请高手 指点!
出错行 : page = trim(Request.QueryString("page")) 展开
5个回答
展开全部
<div><!--开始分页-->
<table width="98%" border="0" cellpadding="2" cellspacing="2" bordercolorlight=#808080 bordercolordark=#ffffff>
<tr style="font-size:12px">
<%if rs.pagecount > 0 then%>
<td width="14%" align="left"> </td>
<%else%>
<td width="11%" align="left"> </td>
<%end if%>
<td width="75%" align="right"><a href="work.asp?page=1">首页</a>|
<%if pre then%>
<a href="work.asp?page=<%=intpage -1%>">上页</a>|
<%end if%>
<%if last then%>
<a href="work.asp?page=<%=intpage +1%>">下页</a> |
<%end if%>
<a href="work.asp?page=<%=rs.PageCount%>">尾页</a>|转到第
<select name="sel_page" onChange="javascript:location=this.options[this.selectedIndex].value;" style="width:auto">
<%
for i = 1 to rs.PageCount
if i = intpage then%>
<option value="work.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="work.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>
<font color="#FFFFFF">页</font> </td>
</tr>
</table>
<!--分页结束--></div>
<table width="98%" border="0" cellpadding="2" cellspacing="2" bordercolorlight=#808080 bordercolordark=#ffffff>
<tr style="font-size:12px">
<%if rs.pagecount > 0 then%>
<td width="14%" align="left"> </td>
<%else%>
<td width="11%" align="left"> </td>
<%end if%>
<td width="75%" align="right"><a href="work.asp?page=1">首页</a>|
<%if pre then%>
<a href="work.asp?page=<%=intpage -1%>">上页</a>|
<%end if%>
<%if last then%>
<a href="work.asp?page=<%=intpage +1%>">下页</a> |
<%end if%>
<a href="work.asp?page=<%=rs.PageCount%>">尾页</a>|转到第
<select name="sel_page" onChange="javascript:location=this.options[this.selectedIndex].value;" style="width:auto">
<%
for i = 1 to rs.PageCount
if i = intpage then%>
<option value="work.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="work.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>
<font color="#FFFFFF">页</font> </td>
</tr>
</table>
<!--分页结束--></div>
展开全部
传过来的page有赋值吗?
page = Request.QueryString("page")试试
page = Request.QueryString("page")试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把:
page = trim(Request.QueryString("page"))
放到:
rs.PageSize = 4 '这里设定每页显示的记录数
前面.
page = trim(Request.QueryString("page"))
放到:
rs.PageSize = 4 '这里设定每页显示的记录数
前面.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在
page = trim(Request.QueryString("page"))
前加
response.write(trim(Request.QueryString("page")))
response.end
看看输出什么估计就知道哪里错了。
page = trim(Request.QueryString("page"))
前加
response.write(trim(Request.QueryString("page")))
response.end
看看输出什么估计就知道哪里错了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
替换成
if len(Request.QueryString("page")) >0then
if isnumeric(Request.QueryString("page")) then
page =Request.QueryString("page")
else
page=1
end if
else
page=1
end if
if len(Request.QueryString("page")) >0then
if isnumeric(Request.QueryString("page")) then
page =Request.QueryString("page")
else
page=1
end if
else
page=1
end if
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询