关于Const MaxPerPage=??

ckxp 2003-04-23 12:10:06
这是分页中的问题,目的是自定义每页显视多少条记录:
dim intbook
intbook=12
Const MaxPerPage=intbook
......略.....

为什么程序执行时总提示出错,出错信息:
Const MaxPerPage=intbook _ '//这里错误

请高手帮忙
...全文
60 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
china520 2003-04-23
  • 打赏
  • 举报
回复
Const 常量的定义
MaxPerPage=intbook
caoshangfei 2003-04-23
  • 打赏
  • 举报
回复
MaxPerPage=intbook不要const
<!--#include file="conn.asp"--> <!--#include file="config.asp"--> <!--#include file="include/header.asp"--> <title><%=webname%>--新闻快讯</title> <% Dim Intcatid,strOrder,strcat,strcategory Intcatid = 0 Intcatid=SafeRequest("catid",1) strcat = "<a href=chknews.asp><FONT COLOR="&bgclr4&">综合新闻</font></a>" set rs=server.CreateObject("adodb.recordset") If Intcatid <> 0 Then rs.open "select category from category where categoryid="&Intcatid&" ",conn,1,1 strcategory = trim(rs("category")) rs.close strcat = strcat &"-><a href=chknews.asp?catid="&Intcatid&" target=_blank>"& strcategory &"</a> " Else End If %> <TABLE WIDTH="780" BORDER="0" CELLSPACING="0" CELLPADDING="0" class=table-zuoyou align="center" BGCOLOR=<%=bgclr2%> background="<% = webimg16 %>"> <TR><TD HEIGHT="30" bgcolor="<% = bgclr1 %>" width="75" class=table-xia><FONT color="#ffffff">&nbsp;<b><FONT COLOR=<%=bgclr4%>>您的位置:</b></FONT></TD> <td class=table-xia>&nbsp;<a href="index.asp"><FONT COLOR=<%=bgclr4%>><%=webname%></font></a><font color="#ffffff">-&gt;</font><a href="chknews.asp"><FONT COLOR=<%=bgclr4%>><% = strcat %></font></a></td></TR></table> <% Const MaxPerPage=20 dim totalPut dim CurrentPage dim TotalPages dim j dim sql if Not isempty(SafeRequest("page",1)) then currentPage=Cint(SafeRequest("page",1)) else currentPage=1 end if If Intcatid = 0 Then rs.open "select newsid,newsname,newscontent,addname,adddate from news Order By adddate desc",conn,1,1 Else rs.open "select newsid,newsname,newscontent,addname,adddate from news Where categoryid = "& Intcatid &" Order By adddate desc ",conn,1,1 End If if rs.eof And rs.bof then Response.Write "<p align='center' class='contents'> 您还没有添加新闻!</p>" else totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPer

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧