求助asp代码改错

zhuliuwu 2010-08-04 10:33:13
if(rsreply.RecordCount!=0){
if(!rsreply.BOF) rsreply.MoveFirst();
while(!rsreply.EOF){
ShowId(rsreply.Fields.Item("id").value,rsreply.Fields.Item("parentid").value,rsreply.Fields.Item("content").value);
iCurrentLocation = rsreply.AbsolutePosition;
ShowChieldren(rsreply,rsreply.Fields.Item("id").Value,rsreply.Filter);
//循环内调用自身取符合Filter的记录
rsreply.AbsolutePosition = iCurrentLocation;
rsreply.MoveNext();
}
}

改成vbscript的代码如下:
if rsreply.RecordCount<>0 then
if not rsreply.BOF then
rsreply.MoveFirst()
end if
while not rsreply.EOF

%>
ShowId(<%=rsreply.Fields.Item("id").value%>,<%=rsreply.Fields.Item("parentid").value%>,<%=rsreply.Fields.Item("content").value%>);
<%

iCurrentLocation = rsreply.AbsolutePosition

%>
ShowChieldren(<%=rsreply%>,<%=rsreply.Fields.Item("id").Value%>,<%=rsreply.Filter%>)
<%
rsreply.AbsolutePosition = iCurrentLocation
rsreply.MoveNext()
wend
end if

目前存在死循环的问题,麻烦高手帮我看看。
...全文
58 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhuliuwu 2010-08-04
  • 打赏
  • 举报
回复
原理我知道,我第一次接触asp,这代码好像有点问题,运行的时候提示:Active Server Pages, ASP 0113 (0x80004005)
超过了脚本运行的最长时间。可以为 Server.ScriptTimeOut 属性指定新值或更改 IIS 管理工具中的相应值来更改此限制。
上网查了下,说是循环的原因。
li88990 2010-08-04
  • 打赏
  • 举报
回复
必须用分级递归方法,先显示父级,再通过ID寻找对应子项,FOR循环实现.
zhuliuwu 2010-08-04
  • 打赏
  • 举报
回复
现在要看,就是麻烦大家看一下我改的循环可对?
zhuliuwu 2010-08-04
  • 打赏
  • 举报
回复
运行在客户端
孟子E章 2010-08-04
  • 打赏
  • 举报
回复
另外,你原来的函数是运行在服务器端还是客户端的?
孟子E章 2010-08-04
  • 打赏
  • 举报
回复
if rsreply.RecordCount<>0 then
if not rsreply.BOF then
rsreply.MoveFirst
end if
while not rsreply.EOF
ShowId(rsreply.Fields.Item("id").value,rsreply.Fields.Item("parentid").value,rsreply.Fields.Item("content").value);

iCurrentLocation = rsreply.AbsolutePosition


ShowChieldren(rsreply,rsreply.Fields.Item("id").Value,rsreply.Filter)

rsreply.AbsolutePosition = iCurrentLocation
rsreply.MoveNext
wend
end if


zhuliuwu 2010-08-04
  • 打赏
  • 举报
回复
多谢!
孟子E章 2010-08-04
  • 打赏
  • 举报
回复
客户端端的代码改到服务器端是不行的,有些代码是操作的HTML DOM,而服务器端是无法做到这一点的。因此,你应当把数据和操作分开来进行处理

28,391

社区成员

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

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