到底是啥子问题???是if,还是sub语法错误?望高人指点。急待。

xiaoyuren81 2003-09-19 10:28:57


我的一个分页程序总提示错误如下:

Microsoft VBScript 编译器错误 (0x800A03EA)
语法错误
/pcm/query1.asp, line 134
sub showpages


按(0x800A03EA)看来是if语句出错(缺少end if)
可下面却提示sub showpages语法错误。


程序如下:
<%


sub showpages
dim ppgg
ppgg= Request.ServerVariables("URL")&"?id="&request("id")
%>
<%If currentPage = 1 Then%>
<font color="#999999">首页</font>|
<font color="#999999">前页</font>|
<A HREF="<%=ppgg%>&Page=<%=currentPage+1%>">后页</A>|
<A HREF="<%=ppgg%>&Page=<%=totalPages%>">尾页</A>
<%else%>
<%If currentPage = totalpages Then%>
<A HREF="<%=ppgg%>">首页</A>|
<A HREF="<%=ppgg%>&Page=<%=currentPage-1%>">前页</A>|
<font color="#999999">后页</font>|
<font color="#999999">尾页</font>
<%else%>
<A HREF="<%=ppgg%>">首页</A>|
<A HREF="<%=ppgg%>&Page=<%=currentPage-1%>">前页</A>|
<A HREF="<%=ppgg%>&Page=<%=currentPage+1%>">后页</A>|
<A HREF="<%=ppgg%>&Page=<%=totalPages%>">尾页</A>
<%
End If
End If
%>
页次:<font color=#ff0000><%=currentPage%>/<%=totalpages%></font>页
共[<font color=#ff0000><%=totalput%></font>]个记录<br><br>
<%
end sub


%>


<%

if totalpages >1 then
showpages
else %>
共一页 [<font color=#ff0000><%=totalput%></font>]条记录
<%
end if
%>
</p>
望高人指点

...全文
150 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
最后多个end if
liudong963 2003-09-20
  • 打赏
  • 举报
回复
你检查一下你这段程序之前是不是有一个if……then 没有End If匹配,你现在这段程序好像没有什么错误的,IIS给你提示这个错误就是在定义showpages过程,If…… Then 还没有相应的End If结束,在If …… Then …… End If(包括任何指定范围内语句体,比如for、while、sub等)中不能定义任何过程(sub)、函数(function)和类(Class)。

所以错误一定出在134行之前,就是缺少End If或其他相应结束语句,可以在sub showpages之前,插入一条response.end来检测错误。


/pcm/query1.asp, line 134
sub showpages
quady 2003-09-20
  • 打赏
  • 举报
回复
你试了没有?
先改了试试吧。
所谓一个语句结束的标志,就类似C语言里面每一个语句后面都要用分号来结束。
但是ASP里面是没有这个的。
xiaoyuren81 2003-09-20
  • 打赏
  • 举报
回复
up
xiaoyuren81 2003-09-20
  • 打赏
  • 举报
回复
up
xiaoyuren81 2003-09-20
  • 打赏
  • 举报
回复
用response.end有用吗?
什么是“没有用符号来作为语句完结的标志”?
超级大笨狼 2003-09-19
  • 打赏
  • 举报
回复
ppgg= Request.ServerVariables("URL")&"?id="&request("id")
太复杂了,得到了什么?别的东西我看起来没什么毛病
我做分页一次就成功,再也没失手过
quady 2003-09-19
  • 打赏
  • 举报
回复
由于ASP里面是没有用符号来作为语句完结的标志,所以,处理的时候一定要看清楚点。
quady 2003-09-19
  • 打赏
  • 举报
回复
<%else%>
<%If currentPage = totalpages Then%>
这里改成:
<%else If currentPage = totalpages Then%>
然后取掉一个End If
试试


或者
<%else%>
<%If currentPage = totalpages Then%>
改成:
<%else
If currentPage = totalpages Then
%>
不用去掉End If
试试
wangwm 2003-09-19
  • 打赏
  • 举报
回复
好像多了一个end if
if ... then
...
else if... then
...
end if
coffee_cn 2003-09-19
  • 打赏
  • 举报
回复
也有可能是上面出了问题
response.end看看有没有什么错误

if totalpages >1 then
showpages
else %>
共一页 [<font color=#ff0000><%=totalput%></font>]条记录
<%
end if

28,406

社区成员

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

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