问题描述
- ASP网站出错 求好心人帮忙
-
报错内容:
Microsoft VBScript 编译器错误 '800a0400'缺少语句
cesAppCodePager.asp, line 51
Host by NetBox Version 2.8 Build 4128
Pager.asp,源代码如下
<% '-------------------------------------------------------------------- '名称:ASP分页类 v2009 ' '作者:zhengbi ' '仅供参考, '仅供参考。 '-------------------------------------------------------------------- Class TurnPage Dim sPageNo,sPageSize,sPageCount,sRecordCount,sAbsoluteRecord Private Sub Class_Initialize() sPageNo=Trim(Request.QueryString("PageNo")) If sPageNo<>"" Then sPageNo = Cdbl(sPageNo) Else sPageNo = 1 End If sAbsoluteRecord = 1 End Sub Public Sub GetRs(ByRef Conn,ByRef Rs,ByVal Sql,ByVal PageSize) Rs.Open Sql,Conn,1,1 Rs.PageSize = PageSize sPageSize = Rs.PageSize sPageCount = Rs.PageCount sRecordCount = Rs.RecordCount If Not Rs.Eof Then Rs.AbsolutePage = sPageNo End Sub Public Function Eof() If sAbsoluteRecord<=sPageSize Then 'sAbsoluteRecord = sAbsoluteRecord + 1 Eof = False Else Eof = True End If End Function Public Sub MoveNext() sAbsoluteRecord = sAbsoluteRecord + 1 End Sub Public Sub GetPageList() Dim sURL,sTmp,sQUERY_STRING,p,n,i,a,b sURL = Request.ServerVariables("URL") sURL = "" '特殊 sQUERY_STRING = Request.ServerVariables("QUERY_STRING") //sTmp = Split(sURL,"/") //sURL = sTmp(Ubound(sTmp)) If sQUERY_STRING <> "" Then sQUERY_STRING=Replace(sQUERY_STRING,"PageNo=" & sPageNo,"") If sQUERY_STRING = "" Then sURL = sURL & "?" Else sURL = sURL & "?" & sQUERY_STRING & "&" End If sURL = Replace(sURL,"&&","&") p = sPageNo-1 n = sPageNo+1 If p<1 Then p = 1 If n>sPageCount Then n = sPageCount a = sPageNo-3 b = sPageNo+3 If a<1 Then a = 1 If b>sPageCount Then b = sPageCount strListNewsPage = "<div style='width:auto;float:center;font-size:12px;text-align:center;height:30px;line-height:30px;'>" If sPageNo > 1 Then strListNewsPage = strListNewsPage & ("<a href='" & sURL & "PageNo=1' style='color:#595a79'>首 页</a>" & VbCrLf) strListNewsPage = strListNewsPage & (" <a href='" & sURL & "PageNo=" & sPageNo - 1 & "' style='color:#595a79'>上 页</a>" & VbCrLf) Else strListNewsPage = strListNewsPage & (" 首 页" & VbCrLf) strListNewsPage = strListNewsPage & (" 上一页" & VbCrLf) End If If sPageNo < sPageCount Then strListNewsPage = strListNewsPage & (" <a href='" & sURL & "PageNo=" & sPageNo + 1 & "' style='color:#595a79'>下 页</a> " & VbCrLf) strListNewsPage = strListNewsPage & (" <a href='" & sURL & "PageNo="&sPageCount&"' style='color:#595a79'>尾 页</a>" & VbCrLf) Else strListNewsPage = strListNewsPage & (" 下一页" & VbCrLf) strListNewsPage = strListNewsPage & (" 尾 页" & VbCrLf) End If strListNewsPage = strListNewsPage & (" 页次(页): <font color=red>" & sPageNo & "</font>/<font color=red>"&sPageCount&"</font> 记录(条):<font color=red> " & sRecordCount & "</font>") strListNewsPage = strListNewsPage & " 转到 <input type='input' name='page' size='2' maxlength='6' value='" & sPageNo & "' class=smallInput> 页" strListNewsPage = strListNewsPage & " <img src="&Application(SiteID & "_HK_SitePath")&"images/go.gif align=absmiddle style='cursor:hand' onClick=""JavaScript:self.location.href='" & sURL & "PageNo=' + page.value ;"">" & VbCrLf strListNewsPage = strListNewsPage & "</div>" response.write strListNewsPage End Sub Public Sub GetPageHtmlList(BaseURL) Dim p,n,i,a,b p = sPageNo-1 n = sPageNo+1 If p<1 Then p = 1 If n>sPageCount Then n = sPageCount a = sPageNo-3 b = sPageNo+3 If a<1 Then a = 1 If b>sPageCount Then b = sPageCount Response.Write("<div class=""page_nav"">") 'If sPageNo>1 Then If p=1 Then Url = BaseURL Else Url = BaseURL & "_" & p End If Response.Write("<a href=""" & BaseURL & ".html"">首页</a> <a href=""" & Url & ".html"">上页</a>") 'End If For i=a To b If i=1 Then Url = BaseURL Else Url = BaseURL & "_" & i End If Response.Write(" <a href=""" & Url & ".html""") If i = sPageNo Then Response.Write(" style=""font-weight:bold; color:#FF0000;""") Response.Write(">" & i & "</a>") Next 'If sPageNo < sPageCount Then If n=1 Then Url = BaseURL Else Url = BaseURL & "_" & n End If If sPageCount=1 Then Url2 = BaseURL Else Url2 = BaseURL & "_" & sPageCount End If Response.Write(" <a href=""" & Url & ".html"">下页</a> <a href=""" & Url2 & ".html"">末页</a>") 'End If Response.Write("</div>") End Sub End Class %>
解决方案
vbs的注释符号是单引号,不是双斜杠
//sTmp = Split(sURL,"/")
//sURL = sTmp(Ubound(sTmp))
==>>
'sTmp = Split(sURL,"/")
'sURL = sTmp(Ubound(sTmp))
解决方案二:
你里面注释符用错了
//sTmp = Split(sURL,"/")
//sURL = sTmp(Ubound(sTmp))
vbs注释符是单引号,也就是说你上面要修改成:
'sTmp = Split(sURL,"/")
'sURL = sTmp(Ubound(sTmp))
时间: 2024-12-31 12:26:15