asp中do loop循环问题
下面是代码Dimrs,sqlSetrs=server.CreateObject("adodb.recordset")sql="select*fromQianbo_Navi...
下面是代码
Dim rs, sql
Set rs = server.CreateObject("adodb.recordset")
sql = "select * from Qianbo_Navigation where ViewFlag order by Sequence asc"
rs.Open sql, conn, 1, 1
If rs.bof And rs.EOF Then
response.Write "暂无导航"
Else
Do
If ISHTML = 1 Then
response.Write " <li><a href="""&rs("HtmlNavUrl")&""" title="""&rs("NavName")&""">"&rs("NavName")&"</a></li>"
Else
response.Write "<LI class=menu_fL cut><A class=menuLink href="&rs("NavUrl")&"><SPAN>"&rs("NavName")&"</SPAN></A></LI>"
End If
rs.movenext
Loop Until rs.EOF
End If
rs.Close
Set rs = Nothing
End Function
%>
<%
Function HeadNavigationMenu()
Dim rs, sql ,rs_sort,Sql_sort,jj
Set rs = server.CreateObject("adodb.recordset")
Set rs_SORT = server.CreateObject("adodb.recordset")
sql = "select * from Qianbo_Navigation where ViewFlag order by Sequence asc"
rs.Open sql, conn, 1, 1
sql_sort = "select * from Qianbo_ProductSort order by id asc"
rs_sort.Open sql_sort, conn, 1, 1
If rs.bof And rs.EOF Then
response.Write "暂无导航"
Else
Do
if rs("NavNAme")="网上商城" then
do
if len(rs_sort("sortpath"))<5 and rs_sort("sortname")="家居" then
jj=rs_sort("sortpath")
%>
<LI class="fL headMenuMore" id=jajuMenu><A class="menuLink more"
href="ProductList.asp?SortID=<%=rs_sort("id")%>"><B></B><SPAN><%=rs_sort("SortName")%></SPAN><B></B></A></A>
<%end if
if len(rs_sort("sortpath"))>5 and left(rs_sort("sortpath"),3)=left(jj,3) then%>
<DIV class=headMenuMoreWraper id=jajuMenu1>
<DIV class=headMenuMoreList id=jajuMenu2>
<DIV class="first"><A href="ProductList.asp?SortID=<%=rs_sort("id")%>"><%=rs_sort("SortName")%></A></DIV>
<%
end if
rs_sort.movenext
loop until rs_sort.eof
rs_sort.movefirst
%>
</DIV></DIV></LI>
<%
do
if len(rs_sort("sortpath"))<5 and rs_sort("sortname")="建材" then
jj=rs_sort("sortpath")
%>
<LI class="fL headMenuMore" id=jiancaiMenu><A class="menuLink more"
href="ProductList.asp?SortID=<%=rs_sort("id")%>"><B></B><SPAN><%=rs_sort("SortName")%></SPAN><B></B></A>
<%
end if
if len(rs_sort("sortpath"))>5 and left(rs_sort("sortpath"),3)=left(jj,3) then
%>
<DIV class=headMenuMoreWraper id=jiancaiMenu1>
<DIV class=headMenuMoreList id=jiancaiMenu2>
<DIV class="first"><A
href="ProductList.asp?SortID=<%=rs_sort("id")%>"><%=rs_sort("SortName")%></A></DIV>
<%
rs_sort.movenext
loop until rs_sort.eof
%>
</DIV></DIV></LI>
<%
else
response.Write "<LI class=menu_fL cut><A class=menuLink href="&rs("NavUrl")&"><SPAN>"&rs("NavName")&"</SPAN></A></LI>"
rs.movenext
end if
Loop Until rs.EOF
End If
rs_sort.Close
Set rs_sort = Nothing
rs.Close
Set rs = Nothing
运行以后出现错误
错误类型:
Microsoft VBScript 编译器错误 (0x800A040E)
'loop' 语句缺少 'do'
/Include/inc.asp, line 465 //就是这谢代码所在的文件 //465行是第二个loop until rs_sort.eof
loop until rs_sort.eof
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
网页:
GET /test.asp
时间:
2010年9月11日, 14:59:34
详细信息: 展开
Dim rs, sql
Set rs = server.CreateObject("adodb.recordset")
sql = "select * from Qianbo_Navigation where ViewFlag order by Sequence asc"
rs.Open sql, conn, 1, 1
If rs.bof And rs.EOF Then
response.Write "暂无导航"
Else
Do
If ISHTML = 1 Then
response.Write " <li><a href="""&rs("HtmlNavUrl")&""" title="""&rs("NavName")&""">"&rs("NavName")&"</a></li>"
Else
response.Write "<LI class=menu_fL cut><A class=menuLink href="&rs("NavUrl")&"><SPAN>"&rs("NavName")&"</SPAN></A></LI>"
End If
rs.movenext
Loop Until rs.EOF
End If
rs.Close
Set rs = Nothing
End Function
%>
<%
Function HeadNavigationMenu()
Dim rs, sql ,rs_sort,Sql_sort,jj
Set rs = server.CreateObject("adodb.recordset")
Set rs_SORT = server.CreateObject("adodb.recordset")
sql = "select * from Qianbo_Navigation where ViewFlag order by Sequence asc"
rs.Open sql, conn, 1, 1
sql_sort = "select * from Qianbo_ProductSort order by id asc"
rs_sort.Open sql_sort, conn, 1, 1
If rs.bof And rs.EOF Then
response.Write "暂无导航"
Else
Do
if rs("NavNAme")="网上商城" then
do
if len(rs_sort("sortpath"))<5 and rs_sort("sortname")="家居" then
jj=rs_sort("sortpath")
%>
<LI class="fL headMenuMore" id=jajuMenu><A class="menuLink more"
href="ProductList.asp?SortID=<%=rs_sort("id")%>"><B></B><SPAN><%=rs_sort("SortName")%></SPAN><B></B></A></A>
<%end if
if len(rs_sort("sortpath"))>5 and left(rs_sort("sortpath"),3)=left(jj,3) then%>
<DIV class=headMenuMoreWraper id=jajuMenu1>
<DIV class=headMenuMoreList id=jajuMenu2>
<DIV class="first"><A href="ProductList.asp?SortID=<%=rs_sort("id")%>"><%=rs_sort("SortName")%></A></DIV>
<%
end if
rs_sort.movenext
loop until rs_sort.eof
rs_sort.movefirst
%>
</DIV></DIV></LI>
<%
do
if len(rs_sort("sortpath"))<5 and rs_sort("sortname")="建材" then
jj=rs_sort("sortpath")
%>
<LI class="fL headMenuMore" id=jiancaiMenu><A class="menuLink more"
href="ProductList.asp?SortID=<%=rs_sort("id")%>"><B></B><SPAN><%=rs_sort("SortName")%></SPAN><B></B></A>
<%
end if
if len(rs_sort("sortpath"))>5 and left(rs_sort("sortpath"),3)=left(jj,3) then
%>
<DIV class=headMenuMoreWraper id=jiancaiMenu1>
<DIV class=headMenuMoreList id=jiancaiMenu2>
<DIV class="first"><A
href="ProductList.asp?SortID=<%=rs_sort("id")%>"><%=rs_sort("SortName")%></A></DIV>
<%
rs_sort.movenext
loop until rs_sort.eof
%>
</DIV></DIV></LI>
<%
else
response.Write "<LI class=menu_fL cut><A class=menuLink href="&rs("NavUrl")&"><SPAN>"&rs("NavName")&"</SPAN></A></LI>"
rs.movenext
end if
Loop Until rs.EOF
End If
rs_sort.Close
Set rs_sort = Nothing
rs.Close
Set rs = Nothing
运行以后出现错误
错误类型:
Microsoft VBScript 编译器错误 (0x800A040E)
'loop' 语句缺少 'do'
/Include/inc.asp, line 465 //就是这谢代码所在的文件 //465行是第二个loop until rs_sort.eof
loop until rs_sort.eof
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
网页:
GET /test.asp
时间:
2010年9月11日, 14:59:34
详细信息: 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询