进来拿分啊~

susan930 2004-04-02 03:00:32
不过先要帮我找一个小错误!~_~
<% tablelast()
LineNo=LineNo+1
RS.MoveNext
Loop
Response.write title
if (RS.bof or RS.eof) and request("action")="" Then
call writemsg()
end if
RS.Close
end sub%>



错误类型:
Microsoft VBScript 编译器错误 (0x800A03F4)
缺少 'If'
/MyBBS/Inc/read.asp, line 167, column 4
end sub
---^

...全文
35 21 打赏 收藏 转发到动态 举报
写回复
用AI写文章
21 条回复
切换为时间正序
请发表友善的回复…
发表回复
susan930 2004-04-02
  • 打赏
  • 举报
回复
我够注意了,还是找不出!
andraw2002 2004-04-02
  • 打赏
  • 举报
回复
注意一下是否已经匹配了if——end if
jingfeng198 2004-04-02
  • 打赏
  • 举报
回复
看的頭暈
susan930 2004-04-02
  • 打赏
  • 举报
回复
up
susan930 2004-04-02
  • 打赏
  • 举报
回复
技术信息(用于支持人员)

错误类型:
Microsoft VBScript 编译器错误 (0x800A03F4)
缺少 'If'
/MyBBS/Inc/read.asp, line 170, column 4
end sub
---^
cxj1976 2004-04-02
  • 打赏
  • 举报
回复
最后还是却一个end if呀
susan930 2004-04-02
  • 打赏
  • 举报
回复
title="<form Name='frmPage'><div align='center'>第 " & RS.AbsolutePage & "/" & RS.PageCount & "页 共 " & RS.RecordCount & " 条记录 "
If Rs.AbsolutePage>1 Then
title=title & "<a href=?page=" & RS.AbsolutePage-1 & ">上一页</a>"
Else
If RS.AbsolutePage<RS.PageCount Then
title=title & " "& "<a href=?page=" & RS.AbsolutePage+1 & ">下一页</a>"
Else
title=title & " 下一页"
End If
If RS>AbsolutePage>1 Then
title=title & " " & "<a href=?page=1>首页</a>"
Else
title=title & " 首页"
End If
If RS.AbsolutePage<RS.PageCount Then
title=title & " " & "<a href=?page=" & RS.PageCount &">尾 页</a>"
Else
title=title & " 第<Input type=text class=flattext Name='pageno' onKeyPress='gopage()' size=4> 页</div><form>"

改成
title="<form Name='frmPage'><div align='center'>第 " & RS.AbsolutePage & "/" & RS.PageCount & "页 共 " & RS.RecordCount & " 条记录 "
If Rs.AbsolutePage>1 Then
title=title & "<a href=?page=" & RS.AbsolutePage-1 & ">上一页</a>"
Else
'------------------------------
title=title & "上一页"
end if
'---------------------------------在这里改
If RS.AbsolutePage<RS.PageCount Then
title=title & " "& "<a href=?page=" & RS.AbsolutePage+1 & ">下一页</a>"
Else
title=title & " 下一页"
End If
If RS>AbsolutePage>1 Then
title=title & " " & "<a href=?page=1>首页</a>"
Else
title=title & " 首页"
End If
If RS.AbsolutePage<RS.PageCount Then
title=title & " " & "<a href=?page=" & RS.PageCount &">尾 页</a>"
Else
title=title & " 第<Input type=text class=flattext Name='pageno' onKeyPress='gopage()' size=4> 页</div><form>"

还是错啊!
pizixt 2004-04-02
  • 打赏
  • 举报
回复
仔细看下面这段少了什么

title="<form Name='frmPage'><div align='center'>第 " & RS.AbsolutePage & "/" & RS.PageCount & "页 共 " & RS.RecordCount & " 条记录 "
If Rs.AbsolutePage>1 Then
title=title & "<a href=?page=" & RS.AbsolutePage-1 & ">上一页</a>"
Else
If RS.AbsolutePage<RS.PageCount Then
title=title & " "& "<a href=?page=" & RS.AbsolutePage+1 & ">下一页</a>"
Else
title=title & " 下一页"
End If
If RS>AbsolutePage>1 Then
title=title & " " & "<a href=?page=1>首页</a>"
Else
title=title & " 首页"
End If
If RS.AbsolutePage<RS.PageCount Then
title=title & " " & "<a href=?page=" & RS.PageCount &">尾 页</a>"
Else
title=title & " 第<Input type=text class=flattext Name='pageno' onKeyPress='gopage()' size=4> 页</div><form>"



发现问题没?

首先缺少匹配的END IF,其次上下页的判断也不对
pizixt 2004-04-02
  • 打赏
  • 举报
回复
<font color="#ffb1c0">/</font> 第 ... 条留言</td>
____________^
dout 2004-04-02
  • 打赏
  • 举报
回复
bangding
susan930 2004-04-02
  • 打赏
  • 举报
回复
up
susan930 2004-04-02
  • 打赏
  • 举报
回复
本来最后面原来的代码是:
elseif (RS.bof or RS.eof) and request("action")="" Then
call writemsg()
end if
RS.Close
end sub%>
但是提示:没有end
后来我改成
if (RS.bof or RS.eof) and request("action")="" Then
call writemsg()
end if
RS.Close
end sub%>
它又提示:
错误类型:
Microsoft VBScript 编译器错误 (0x800A03F4)
缺少 'If'
/MyBBS/Inc/read.asp, line 167, column 4
end sub
---^
susan930 2004-04-02
  • 打赏
  • 举报
回复
不好意思,我马上放出全码:
<!--#include file="writemsg.asp"-->
<%CurPageName=Request.Servervariables("SCRIPT_NAME")%>
<Script Language="VBScript">
Sub gopage()
If window.event.keycode=13 Then
pno=document.frmPage.pageno.value
window.location.href="<%=CurPageName%>?page=" & pno
End If
End Sub
</Script>
<%
Sub read()
sqlmsg="select * from message order by id desc"
Set RS=Server.CreateObject("ADODB.RecordSet")
RS.open sqlmsg,conn,1,1
If not RS.bof and not RS.eof Then
RS.pagesize=bbspagesize
getpageno=request.QueryString("page")
If getpageno="" or Int(getpageno)<=1 Then
pageno=1
Else
pageno=getpageno
If pageno>RS.pagecount Then
pageno=RS.pagecount
End If
End If
RS.AbsolutePage=pageno
title="<form Name='frmPage'><div align='center'>第 " & RS.AbsolutePage & "/" & RS.PageCount & "页 共 " & RS.RecordCount & " 条记录 "
If Rs.AbsolutePage>1 Then
title=title & "<a href=?page=" & RS.AbsolutePage-1 & ">上一页</a>"
Else
If RS.AbsolutePage<RS.PageCount Then
title=title & " "& "<a href=?page=" & RS.AbsolutePage+1 & ">下一页</a>"
Else
title=title & " 下一页"
End If
If RS>AbsolutePage>1 Then
title=title & " " & "<a href=?page=1>首页</a>"
Else
title=title & " 首页"
End If
If RS.AbsolutePage<RS.PageCount Then
title=title & " " & "<a href=?page=" & RS.PageCount &">尾 页</a>"
Else
title=title & " 第<Input type=text class=flattext Name='pageno' onKeyPress='gopage()' size=4> 页</div><form>"
%>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="80"><img src="images/bulletin.gif" width="18" height="18" align="absmiddle"><b>公告: </b></td>
<td width="437">
<marquee scrollamount=3><%=bbsbulletin%></marquee></td>
<td width="30"> </td>
<td width="203">
版主: <a href="mailto:<%=adminmail%>"><%=adminname%></a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="1">
<tr>
<td height="1" width="22%" bgcolor="#ffb1c0" align="center">
<img height=1 src="css/line.gif" width="120" border=0></td>
<td height="1" width="1" bgcolor="#ffb1c0" align="center"></td>
<td width="410" height="1" bgcolor="#ffb1c0"></td>
</tr>
</table>
<%
Lineno=1
Do While not RS.eof and Lineno<=RS.pagesize
tablefirst() %>
<table width="100%" border="0" cellspacing="0" cellpadding="0" heiht="136" align="center">
<tr>
<td bgcolor=#fff1f7 align="center">
<table width="120" border="0" cellspacing="0" cellpadding="2" height="136">
<tr>
<td height="40" colspan="2" $d3e5fa><div align="center">
<img src="images/<%=RS("pic")%>.gif" width="40" height="40"></div>
</td>
</tr>
<tr>
<td height="8" colspan="2"><div align="center">
<%=RS("username")%></div>
</td>
</tr>
<tr>
<td width="6%"><div align="center">
<img src="images/homepage.gif" width="16" height="16"></div>
</td>
<td width="14%"><a href="mailto:<%=RS("email")%>" title="给<%=RS("username")%>发信">写信给我</a></td>
<tr>
<td width="6%" valign="top"><div align="center">
<img src="images/oicq.gif" width="16" height="16"></div>
</td>
<td width="14%" valign="bottom">
<% iF rs("QQ")<>"" Then
Response.write RS("qq")
Else
Response.write "不告诉你"
End If%>
</td>
</tr>
</table><tr>
</td>
<td vAlign=top bgColor="#ffb1c0" rowspan="2" width=1>
<img src="images/space.gif" width=1>
</td>
<td width="410">
<table cellspacing=0 cellpadding=1 width="100%" align=center border=0>
<tr>
<td>
<table bordercolor=#111111 cellspacing=0 cellpadding=0 border=0 width="423" style="table-layout:fixed">
<tr>
<td valign=center height="20" style="Left:0px;width:76%; Word-Wrap:break-word"> 
<%=RS("username")%>发表于: <%=RS("leavetime")%></td>
<td align="right" height="20" style="Left:0px;Width:24%;Word-Wrap:break-word">
<font color=#ffb1c0">/</font> 第 <%RS.recordcount-RS.pagesize*(pageno-1)-LineNo+1%>条留言</td>
</tr>
<tr valign="top"><td colspan="2" height="10">
<img height=1 src="css/line.gif" width="100%"></td>
</tr>
</table>
<table width="423" border="0" cellspacing="0" cellpadding="3" BorderColorLight="#333333" BorderColorDark="#ffffff" style="Table-Layout:fixed" height="100">
<tr>
<td colspan="2" style="Left:0px;Width:100%;Word-Wrap:break-word">
<%
msg=RS("message")
msg=Replace(msg,"<br>","<tr>")
msg=Replace(msg,chr(10),"<br>")
msg=Replace(msg,vbCrLf,"<br>")
Response.Write msg %>
</td>
</tr>
</table>
<table style="border-collapse:collapse;Table-Talbe-Layout:fixed" BorderColor=#111111 Cellspacing=0 Cellpadding=0 width="423" Border=0>
<tr>
<td valign=bottom height="10">
<img height=1 src="css/line.gif" width="100%"></td>
<tr>
<td valign=bottom height="20" style="Left:0px;Width:100%;Word-Wrap:break-word"> 
<img src="images/ip.gif" width="16" height="15" align="absmiddle" border="0">来自: <%=RS("from_address")%> 
<img src="images/post.gif" width="16" height="16" border="0" align="absmiddle"><a href="?action=write%>">签写留言</a>
<img src="images/replynow.gif" width="16" height="16" align="absmiddle" border="0"><a href="?action=reply&msgid=<%=RS("id")%>">回复留言</a>
<%If session("user")="admin" Then%>
<img src="images/edit.gif" width="16" height="15" align="absmiddle" border="0"><a href="?action=edit&msgid=<%=RS("id")%>&page=<%=pageno%>">编辑</a>
<img src="images/del.gif" width="15" height="15" align="absmiddle" border="0"><a href="?action=delete&msgid=<%=RS("id")%>&page=<%=pageno%>">删除</a>
<%end if%>
</td>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="1" width="22%" bgcolor="#ffb1c0" align="center">
<img height=1 src="css/line.gif" width="120" border=0></td>
<td width="410" height="1" bgcolor="#ffb1c0"></td>
</tr>
</table>
<% tablelast()
LineNo=LineNo+1
RS.MoveNext
Loop
Response.write title
if (RS.bof or RS.eof) and request("action")="" Then
call writemsg()
end if
RS.Close
end sub%>




driftarter 2004-04-02
  • 打赏
  • 举报
回复
代码不全,不好分析
Ccode 2004-04-02
  • 打赏
  • 举报
回复
把这个去掉end sub

你应该不是函数吧?
suntoday 2004-04-02
  • 打赏
  • 举报
回复
全部贴出来吧,
wozhenbei 2004-04-02
  • 打赏
  • 举报
回复
把整个代码铁出来啊
若白师妹 2004-04-02
  • 打赏
  • 举报
回复
if (RS.bof or RS.eof) and request("action")="" Then 有問題

guokai1217 2004-04-02
  • 打赏
  • 举报
回复
分在哪?我来拿了。
xxrl 2004-04-02
  • 打赏
  • 举报
回复
167行是哪一行?代码不全啊
加载更多回复(1)

28,391

社区成员

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

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