Microsoft VBScript 编译器错误 '800a03ee' 缺少 ')'

buxiyang 2008-01-31 06:19:47
我是初学ASP,准备使用开放博客源代码acblog,可是调试时出现很多错误"Microsoft VBScript 编译器错误 '800a03ee' 缺少 ')' ",就在Response.Write 语句行,请高手指教!代码如下:
Do While Not TagRS.Eof
IF TagRS("TagBlogCount")>=cint(MAXTag*0.2) AND TagRS("TagBlogCount")<=cint(MAXTag*0.6) Response.Write ("<a href="BloglistTag.asp?tags=""&Server.URLEncode(TagRS("TagName"))&""><span class="Tag_size2" title="此Tag共有"&TagRS("TagBlogCount")&"篇日志>" & TagRS("TagName") & "</span></a>")[/color]ElseIF TagRS("TagBlogCount")>cint(MAXTag*0.6) AND TagRS("TagBlogCount")<=cint(MAXTag*0.9) Then
Response.Write ("<a href=""BloglistTag.asp?tags="&Server.URLEncode(TagRS("TagName"))&"""><span class=""Tag_size3"" title=""此Tag共有"&TagRS("TagBlogCount")&"篇日志"">" & TagRS("TagName") & "</span></a>")
ElseIF TagRS("TagBlogCount")>cint(MAXTag*0.9) Then
Response.Write ("<a href=""BloglistTag.asp?tags="&Server.URLEncode(TagRS("TagName"))&"""><span class=""Tag_size4"" title=""此Tag共有"&TagRS("TagBlogCount")&"篇日志"">" & TagRS("TagName") & "</span></a>")
Else
Response.Write ("<a href=""BloglistTag.asp?tags="&Server.URLEncode(TagRS("TagName"))&"""><span class=""Tag_size1"" title=""此Tag共有"&TagRS("TagBlogCount")&"篇日志"">" & TagRS("TagName") & "</span></a>")
End IF
Response.Write (" | ")
TagRS.MoveNext
Loop
...全文
2010 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
l75661220 2010-06-29
  • 打赏
  • 举报
回复
...
wlkjhxd 2008-03-21
  • 打赏
  • 举报
回复
有个地方多了一个",你再试一下下面的代码

<%
Sub TagsList(tMode)

Dim TagRS,MAXTag

IF tMode="Hot" Then
Sql="Select TOP 20 * from blog_tags order by TagBlogCount desc, CreateDate asc"
Else
Sql="Select * from blog_tags order by CreateDate desc"
End IF

Set TagRS = Server.CreateObject("Adodb.RecordSet")
TagRS.Open Sql,Conn,1,1
IF TagRS.Eof AND TagRS.Bof Then
Response.Write ("目前没有 Tags 分类.")
Else
'得到当前最多日志分类数
MAXTag=conn.Execute("select top 1 TagBlogCount From Blog_Tags Order By TagBlogCount Desc")(0)

Do While Not TagRS.Eof

IF TagRS("TagBlogCount")>=cint(MAXTag*0.2) AND TagRS("TagBlogCount") <=cint(MAXTag*0.6) then
%>
<a href="BloglistTag.asp?tags= <%=Server.URLEncode(TagRS("TagName"))%>"> <span class="Tag_size2" title="此Tag共有 <%=TagRS("TagBlogCount")%>篇日志"> <%=TagRS("TagName")%> </span> </a>
<%
Else IF TagRS("TagBlogCount")> cint(MAXTag*0.6) AND TagRS("TagBlogCount") <=cint(MAXTag*0.9) Then
%>
<a href="BloglistTag.asp?tags= <%=Server.URLEncode(TagRS("TagName"))%>"> <span class="Tag_size3" title="此Tag共有 <%=TagRS("TagBlogCount")%>篇日志"> <%=TagRS("TagName")%> </span> </a>
<%
Else IF TagRS("TagBlogCount")> cint(MAXTag*0.9) Then
%>
<a href="BloglistTag.asp?tags= <%=Server.URLEncode(TagRS("TagName"))%>"> <span class="Tag_size4" title="此Tag共有 <%=TagRS("TagBlogCount")%>篇日志"> <%=TagRS("TagName")%> </span> </a>
<%
Else
%>
<a href="BloglistTag.asp?tags= <%=Server.URLEncode(TagRS("TagName"))%>"> <span class="Tag_size1" title="此Tag共有 <%=TagRS("TagBlogCount")%>篇日志"> <%=TagRS("TagName")%> </span> </a>
<%
End IF
Response.Write("¦")
TagRS.MoveNext
Loop
End IF
TagRS.Close
Set TagRS=NoThing
End Sub
%>
yangtzeu 2008-02-01
  • 打赏
  • 举报
回复
<%
End IF
Response.Write("¦")
TagRS.MoveNext
Loop
End IF
TagRS.Close
Set TagRS=NoThing
End Sub

%>


<%
Loop

End IF
Response.Write("¦")
TagRS.MoveNext

End IF
TagRS.Close
Set TagRS=NoThing
End Sub

%>

试试?
你那些IF else好象没有对应好
gingerkang 2008-02-01
  • 打赏
  • 举报
回复
看看你的if 跟end if 的匹配情况,有5个if条件,3个end if
把你的else if 换成elseif再检查一下
mafengcf 2008-02-01
  • 打赏
  • 举报
回复
Response.Write后直接接雙引號就好了,那樣比較好找錯誤.
buxiyang 2008-02-01
  • 打赏
  • 举报
回复
楼上朋友"月亮之上",您这一改不符合循环显示日志标题的要求了,只有记录集指针移到下一条记录才能循环显示.不过还是要感谢您的热心帮助.
buxiyang 2008-02-01
  • 打赏
  • 举报
回复
非常感谢wlkjhxd (也许有一天)朋友的热心支持,你提供的代码比较明了,出错的机率会降低。现在按照你的代码修改后,原来的问题解决了,又出现了新问题,运行到”LOOP“ 行时提示“Microsoft VBScript 编译器错误 '800a040e'

'loop' 语句缺少 'do' ”。我的代码如下:

'显示TAGS分类
Sub TagsList(tMode)
Dim TagRS,MAXTag
IF tMode="Hot" Then
Sql="Select TOP 20 * from blog_tags order by TagBlogCount desc, CreateDate asc"
Else
Sql="Select * from blog_tags order by CreateDate desc"
End IF
Set TagRS = Server.CreateObject("Adodb.RecordSet")
TagRS.Open Sql,Conn,1,1
IF TagRS.Eof AND TagRS.Bof Then
Response.Write ("目前没有 Tags 分类.")
Else
'得到当前最多日志分类数
MAXTag=conn.Execute("select top 1 TagBlogCount From Blog_Tags Order By TagBlogCount Desc")(0)

Do While Not TagRS.Eof
IF TagRS("TagBlogCount")>=cint(MAXTag*0.2) AND TagRS("TagBlogCount")<=cint(MAXTag*0.6) then
%>
<a href="BloglistTag.asp?tags=<%=Server.URLEncode(TagRS("TagName"))%>"><span class="Tag_size2" title="此Tag共有<%=TagRS("TagBlogCount")%>篇日志"><%=TagRS("TagName")%></span></a>
<%
Else IF TagRS("TagBlogCount")> cint(MAXTag*0.6) AND TagRS("TagBlogCount") <=cint(MAXTag*0.9) Then
%>
<a href=""BloglistTag.asp?tags=<%=Server.URLEncode(TagRS("TagName"))%>"> <span class="Tag_size3" title="此Tag共有<%=TagRS("TagBlogCount")%>篇日志"><%=TagRS("TagName")%></span></a>
<%
Else IF TagRS("TagBlogCount")> cint(MAXTag*0.9) Then
%>
<a href="BloglistTag.asp?tags=<%=Server.URLEncode(TagRS("TagName"))%>"> <span class="Tag_size4" title="此Tag共有<%=TagRS("TagBlogCount")%>篇日志"><%=TagRS("TagName")%></span></a>
<%
Else
%>
<a href="BloglistTag.asp?tags=<%=Server.URLEncode(TagRS("TagName"))%>"> <span class="Tag_size1" title="此Tag共有<%=TagRS("TagBlogCount")%>篇日志"><%=TagRS("TagName")%></span></a>
<%
End IF
Response.Write("¦")
TagRS.MoveNext
Loop
End IF
TagRS.Close
Set TagRS=NoThing
End Sub

%>
wlkjhxd 2008-01-31
  • 打赏
  • 举报
回复
你遇到"的时候可以换成',不过有的时候是必须用"的,所以可以在遇到"的时个换成"",也就是两个双引号;

你还可以这样写


<%
Do While Not TagRS.Eof
IF TagRS("TagBlogCount")> =cint(MAXTag*0.2) AND TagRS("TagBlogCount") <=cint(MAXTag*0.6)
%>
<a href="BloglistTag.asp?tags=<%=Server.URLEncode(TagRS("TagName"))%>"><span class="Tag_size2" title="此Tag共有<%=TagRS("TagBlogCount")%>篇日志"><%=TagRS("TagName")%></span></a>
<%
ElseIF TagRS("TagBlogCount")> cint(MAXTag*0.6) AND TagRS("TagBlogCount") <=cint(MAXTag*0.9) Then
%>
<a href=""BloglistTag.asp?tags=<%=Server.URLEncode(TagRS("TagName"))%>"> <span class="Tag_size3" title="此Tag共有<%=TagRS("TagBlogCount")%>篇日志"><%=TagRS("TagName")%></span></a>
<%
ElseIF TagRS("TagBlogCount")> cint(MAXTag*0.9) Then
%>
<a href="BloglistTag.asp?tags=<%=Server.URLEncode(TagRS("TagName"))%>"> <span class="Tag_size4" title="此Tag共有<%=TagRS("TagBlogCount")%>篇日志"><%=TagRS("TagName")%></span></a>
<%
Else
%>
<a href="BloglistTag.asp?tags=<%=Server.URLEncode(TagRS("TagName"))%>"> <span class="Tag_size1" title="此Tag共有<%=TagRS("TagBlogCount")%>篇日志"><%=TagRS("TagName")%></span></a>
<%
End IF
Response.Write (" ¦ ")
TagRS.MoveNext
Loop
%>
buxiyang 2008-01-31
  • 打赏
  • 举报
回复
本人是采鸟,不太明白楼上yangtzeu的意思,是把""改成",还是把"改成'?
yangtzeu 2008-01-31
  • 打赏
  • 举报
回复
把原来html是双引号"的全部改成单引号就可以了,你那个代码比较乱
buxiyang 2008-01-31
  • 打赏
  • 举报
回复
感谢3位的热心回复。“也许有一天”,你的代码我复制后调试了一下,结果还是"Microsoft VBScript 编译器错误 '800a03ee' 缺少')'"。这段代码比较长,其中字符串与变量混杂在一起,我感觉对“”的使用存在问题,可自己实在调试不出错在哪里,语句行为
Response.Write ("<a href=""BloglistTag.asp?tags="&Server.URLEncode(TagRS("TagName"))&"""><span class=""Tag_size3"" title=""此Tag共有"&TagRS("TagBlogCount")&"篇日志"">" & TagRS("TagName") & "</span></a>")

麻烦各位继续给我挑错误,在此谢谢了!
wlkjhxd 2008-01-31
  • 打赏
  • 举报
回复
Response.Write("<a href=""BloglistTag.asp?tags="&Server.URLEncode("asga")&"""><span class=""Tag_size2"" title=""此Tag共有"&TagRS("TagBlogCount")&"篇日志""> " & TagRS("TagName") & " </span> </a> ")
yanniu008 2008-01-31
  • 打赏
  • 举报
回复
哪一行啊 什么地方
xiaojing7 2008-01-31
  • 打赏
  • 举报
回复
????

28,407

社区成员

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

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