| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1050 人关注过本帖
标题:do while语句出错
取消只看楼主 加入收藏
ywxhqt2005
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-6
收藏
 问题点数:0 回复次数:7 
do while语句出错
大家好,我的index.asp在IE上运行时出现了死循环,系统提示连接超时,以下是源代码,请高手赐教!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>永州职业技术学院成教部欢迎您!</title>
<link href="cjb.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<!--#include file="top.asp"--></td></tr>
<tr>
<td><table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="1" valign="top" bgcolor="#004292"></td>
<td rowspan="4" width="15">&nbsp;</td>
<td><table width="990" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="318" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="182" height="4">&nbsp;</td>
</tr>
<tr>
<td width="182" height="28"><img src="images/gbl2.gif" width="318" height="42" /></td>
</tr>
<tr>
<td><table width="318" border="0" cellspacing="0" cellpadding="0" bgcolor="#F2F2F2">
<%
set oRs=server.createobject("adodb.recordset")
sSql="select top 8 * from news where cataid='公布栏' order by id desc "
oRs.open sSql,oConn,1,1%>
<%dim e
do while not oRs.eof and e<10
if len(oRs("title"))>18 then
title=left(oRs("title"),18)+"…"
else
title=oRs("title")
end if
if len(title)<15 then
addtime=oRs("addtime")
else
addtime=""
end if
%>
<tr>
<td width="25" height="21" align="center" valign="middle"><img src="images/wjj.gif" width="14" height="9" /></td>
<td height="21"><a href="xyxw_view.asp?id=<%=oRs("id")%>"class="ttblue" title=<%=oRs("title")%>><%=title%></a><%=addtime%></td>
</tr>
<%e=e+1
oRs.movenext
loop
oRs.close
if e=1 then%>

<tr>
<td width="18" height="22" align="center" valign="middle"><img src="images/wjj.gif" width="9" height="9"></td>
<td height="22" valign="bottom">还 没 有 任 何 记 录</td>
</tr>
<%end if%>
</table></td>
</tr>
</table></td>
<td><table width="297" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="4">&nbsp;</td>
</tr>
<tr>
<td width="297"><img src="images/zsxx2.gif" width="297" height="42" /></td>
</tr>
<tr>
<td><table width="" border="0" cellspacing="0" cellpadding="0" bgcolor="#F2F2F2">
<tr>
<td><table width="297" border="0" cellspacing="0" cellpadding="0">
<%
set oRs=server.createobject("adodb.recordset")
sSql="select top 8 * from news where cataid='招生信息' order by id desc "
oRs.open sSql,oConn,1,1%>
<%dim f
do while not oRs.eof and f<10
if len(oRs("title"))>18 then
title=left(oRs("title"),18)+"…"
else
title=oRs("title")
end if
if len(title)<15 then
addtime=oRs("addtime")
else
addtime=""
end if
%>
<tr>
<td width="25" height="21" align="center" valign="middle"><img src="images/wjj.gif" width="14" height="9" /></td>
<td height="21"><a href="xyxw_view.asp?id=<%=oRs("id")%>"class="ttblue" title=<%=oRs("title")%>><%=title%></a><%=addtime%></td>
</tr>
<%f=f+1
oRs.movenext
loop
oRs.close
if f=1 then%>

<tr>
<td width="18" height="22" align="center" valign="middle"><img src="images/wjj.gif" width="9" height="9"></td>
<td height="22" valign="bottom">还 没 有 任 何 记 录</td>
</tr>
<%end if%>
</table></td>
</tr>
</table></td>
<td><table width="198" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="4">&nbsp;</td>
</tr>
<tr>
<td><img src="images/cjcx1.gif" width="198" height="63" /></td>
</tr>
<tr>
<td><table width="198" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="4">&nbsp;</td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="42" height="20"><img src="images/xh.gif" width="35" height="15"></td>
<td width="156"><INPUT name=xsxh class="tt" id=xsxh
size=16 maxLength=16></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="42" height="20"><img src="images/xm.gif" width="35" height="15"></td>
<td width="156"><INPUT name=xsxm class="tt" id=xsxm4 size=16></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/tj.gif" width="26" height="12" align="right"></td>
<td width="4">&nbsp;</td>
<td><img src="images/cz.gif" width="26" height="12"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="990" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="387"><table width="318" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="4">&nbsp;</td>
</tr>
<tr>
<td><img src="images/zkkx2.gif" width="318" height="47" /></td>
</tr>
<tr>
<td><table width="" border="0" cellspacing="0" cellpadding="0" bgcolor="#F2F2F2">
<tr>
<td><table width="318" border="0" cellspacing="0" cellpadding="0">
<%
set oRs=server.createobject("adodb.recordset")
sSql="select top 8 * from news where cataid='自考快讯' order by id desc "
oRs.open sSql,oConn,1,1%>
<%dim s
do while not oRs.eof and s<10
if len(oRs("title"))>18 then
title=left(oRs("title"),18)+"…"
else
title=oRs("title")
end if
if len(title)<15 then
addtime=oRs("addtime")
else
addtime=""
end if
%>
<tr>
<td width="25" height="21" align="center" valign="middle"><img src="images/wjj.gif" width="14" height="9" /></td>
<td height="21"><a href="xyxw_view.asp?id=<%=oRs("id")%>"class="ttblue" title=<%=oRs("title")%>><%=title%></a><%=addtime%></td>
</tr>
<%s=s+1
oRs.movenext
loop
oRs.close
if s=1 then%>

<tr>
<td width="18" height="22" align="center" valign="middle"><img src="images/wjj.gif" width="9" height="9"></td>
<td height="22" valign="bottom">还 没 有 任 何 记 录</td>
</tr>
<%end if%>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="361"><table width="297" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><img src="images/cjkx2.gif" width="297" height="47" /></td>
</tr>
<tr>
<td><table width="182" border="0" cellspacing="0" cellpadding="0" bgcolor="#F2F2F2">
<tr>
<td><table width="297" border="0" cellspacing="0" cellpadding="0">
<%
set oRs=server.createobject("adodb.recordset")
sSql="select top 8 * from news where cataid='成教快讯' order by id desc "
oRs.open sSql,oConn,1,1%>
<%dim i
do while not oRs.eof and i<10
if len(oRs("title"))>18 then
title=left(oRs("title"),18)+"…"
else
title=oRs("title")
end if
if len(title)<15 then
addtime=oRs("addtime")
else
addtime=""
end if
%>
<tr>
<td width="25" height="21" align="center" valign="middle"><img src="images/wjj.gif" width="14" height="9" align="center"/></td>
<td height="21"><a href="xyxw_view.asp?id=<%=oRs("id")%>"class="ttblue" title=<%=oRs("title")%>><%=title%></a><%=addtime%></td>
</tr>
<%i=i+1
oRs.movenext
loop
oRs.close
if i=1 then%>

<tr>
<td width="18" height="22" align="center" valign="middle"><img src="images/wjj.gif" width="9" height="9"></td>
<td height="22" valign="bottom">还 没 有 任 何 记 录</td>
</tr>
<%end if%>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="242"><table width="198" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/lqcx1.gif" width="197" height="69"></td>
</tr>
<tr>
<td><a href="#"><img src="images/11.gif" width="198" height="98" border="0"></a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</td>
<td width="1" valign="top" bgcolor="#004292"></td>
</tr>
</tr>
</table>
</table>
<!--#include file="bottom.asp"-->
</body>
</html>
搜索更多相关主题的帖子: 语句 
2007-06-06 16:55
ywxhqt2005
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-6
收藏
得分:0 
在线等,急!
2007-06-06 16:57
ywxhqt2005
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-6
收藏
得分:0 
<table width="297" border="0" cellspacing="0" cellpadding="0">
<%
set oRs=server.createobject("adodb.recordset")
sSql="select top 8 * from news where cataid='招生信息' order by id desc "
oRs.open sSql,oConn,1,1%>
<%dim f
do while not oRs.eof and f<10
if len(oRs("title"))>18 then
title=left(oRs("title"),18)+"…"
else
title=oRs("title")
end if
if len(title)<15 then
addtime=oRs("addtime")
else
addtime=""
end if
%>
<tr>
<td width="25" height="21" align="center" valign="middle"><img src="images/wjj.gif" width="14" height="9" /></td>
<td height="21"><a href="xyxw_view.asp?id=<%=oRs("id")%>"class="ttblue" title=<%=oRs("title")%>><%=title%></a><%=addtime%></td>
</tr>
<%f=f+1
oRs.movenext
loop
oRs.close
if f=1 then%>

<tr>
<td width="18" height="22" align="center" valign="middle"><img src="images/wjj.gif" width="9" height="9"></td>
<td height="22" valign="bottom">还 没 有 任 何 记 录</td>
</tr>
<%end if%>
</table>
2007-06-06 17:22
ywxhqt2005
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-6
收藏
得分:0 

循环语句如下: <%dim f
do while not oRs.eof and f<10
if len(oRs("title"))>18 then
title=left(oRs("title"),18)+"…"
else
title=oRs("title")
end if
if len(title)<15 then
addtime=oRs("addtime")
else
addtime=""
end if
%>
<tr>
<td width="25" height="21" align="center" valign="middle"><img src="images/wjj.gif" width="14" height="9" /></td>
<td height="21"><a href="xyxw_view.asp?id=<%=oRs("id")%>"class="ttblue" title=<%=oRs("title")%>><%=title%></a><%=addtime%></td>
</tr>
<%f=f+1
oRs.movenext
loop
oRs.close
if f=1 then%>

2007-06-06 17:24
ywxhqt2005
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-6
收藏
得分:0 
急!
该网站有病毒干扰。
2007-06-06 17:24
ywxhqt2005
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-6
收藏
得分:0 
回复:(laigaoat2005)对不起啊,我看不明白你的程序...

在你想要发的文件中复制源代码,然后粘贴过来就行了

2007-06-06 17:30
ywxhqt2005
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-6
收藏
得分:0 
是啊,怎么办?我对do while 语句不是很了解,是刚接触ASP不久的那种
2007-06-06 17:50
ywxhqt2005
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-6
收藏
得分:0 
哪位高手帮帮忙啊,在此先谢了!
2007-06-06 17:52
快速回复:do while语句出错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019147 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved