求救?的潜套问题,下面的写法正不正确,

laodiao 2003-08-23 12:12:42
<%
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("redboy/redboy.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rs0= Server.CreateObject("ADODB.Recordset")
set rs1= Server.CreateObject("ADODB.Recordset")
dim node_html,tongji
strSqla="select distinct parentid from tree"
rs0.open strSqla,conn,1,3
do while not rs0.eof
....
strsq1b="select * from tree where parentid='"&rs0("parentid")&"' "
//但是在这儿strsqlb的语句根本不能执行。。这是什么原因
rs1.open strsqlb,conn,1,3
do while not rs1.eof
......
rs1.movenext
loop

rs1.close
set rs1=nothing
rs0.movenext
loop

rs0.close
set rs0=nothing
%>

上面的写法正不正确,
...全文
49 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
laodiao 2003-08-23
  • 打赏
  • 举报
回复
数据表的形式是这样的。。

id char
parentid char
context char
link char

数据形式如下

s1 软件 刁仁宏 http://
s2 软件 哈哈 http://
s3 硬件 路祭 http://
s4 硬件 呵呵 http://


我不知道上面的循环是否正确
pazll 2003-08-23
  • 打赏
  • 举报
回复
就是这句
strsq1b="select * from tree where parentid='"&rs0("parentid")&"' "
加'号是连接字符的。
coffee_cn 2003-08-23
  • 打赏
  • 举报
回复
strsq1b="select * from tree where parentid='"&rs0("parentid")&"' "
把他打印出来看看,
孟子E章 2003-08-23
  • 打赏
  • 举报
回复
parentid类型是字符的马??
ttt2 2003-08-23
  • 打赏
  • 举报
回复
strsq1b="select * from tree where parentid="&rs0("parentid")
laodiao 2003-08-23
  • 打赏
  • 举报
回复
<html>
<head>项目开发几乎</head>
<body>
<%
dim conn ,connstr,node_html,tongji,strsqla,strsq1b
connstr="DBQ="+server.mappath("test.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr

set rs0= Server.CreateObject("ADODB.Recordset")
strsqla="select distinct age from tree"
rs0.open strsqla,conn,1,3
tongji=0
while not rs0.eof
set rs1= Server.CreateObject("ADODB.Recordset")
strsq1b="select * from tree where age='"&rs0("age")&"' "
rs1.open strsqlb,conn,1,3
while not rs1.eof
response.write "diao"
rs1.movenext
wend
rs1.close
response.write "diao"
rs0.movenext
tongji=tongji+1
wend
set rs1=nothing
rs0.close
set rs0=nothing
%>
</body>
</html>

到底错在什么地方啊
laodiao 2003-08-23
  • 打赏
  • 举报
回复
怎么修改它,给你程序好不好。。
cgxf 2003-08-23
  • 打赏
  • 举报
回复
晕!!
高手来了!!这看不出来吗??
在循环中怎么能一直打开rs1 呢??应该在循环中在加一个close 语句!!
记得给分!!

28,390

社区成员

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

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