同样的程序在access中正常,在sql2000中慢的要死

gxq323 2009-09-11 03:07:58

sub selpcls(pid,lvl,cid)
dim rs
dim i
if pid=0 then
response.Write("<select name='pcls' id='pcls'>")
response.Write("<option value=""0"">--选择类别--</option>")
end if
set rs=conn.execute("select id,cls_name,pid from products_cls where pid="&pid)
do while not rs.eof
response.Write("<option value='"&rs("id")&"'")
if trim(cstr(cid))=cstr(rs("id")) then
response.Write("selected=""selected""")
end if
response.Write ">"
if lvl=0 then
response.Write("·"&rs("cls_name"))
else
for i=0 to lvl
response.Write(" ")
next
response.Write("┣"&rs("cls_name"))
end if
response.Write "</option>"
call selpcls(rs("id"),lvl+1,cid)
rs.movenext
loop
set rs=nothing
if pid=0 then
response.Write("</select>")
end if
end sub
字段类型是int varchar int
大侠帮帮忙吧,是不是程序递归造成的,页面里两处用到递归,另外一个和这个差不多,还有更好的方法吗??
...全文
105 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
gxq323 2009-09-11
  • 打赏
  • 举报
回复
您说对了,还真是,sql2000和access还有这区别呀,谢谢您了
tikecoke 2009-09-11
  • 打赏
  • 举报
回复
set rs=conn.execute("select id,cls_name,pid from products_cls where pid="&pid)
直接执行execute 换成创建记录集再用open打开记录集看看.感觉循环有问题,有时记录集没关闭情况下又打开一个记录集.
gxq323 2009-09-11
  • 打赏
  • 举报
回复
大家帮忙分析分析,别让我一个人顶贴了,难道是缺少数据库的补丁吗
gxq323 2009-09-11
  • 打赏
  • 举报
回复
没人知道是什么原因吗?xp,本地测试打开别的页面挺正常的,就是打开分类设置这个页面慢,不是一般的慢,access的话就正常
gxq323 2009-09-11
  • 打赏
  • 举报
回复
自己先顶了

28,391

社区成员

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

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