实际情况如下: select c_no from table where p_no="输入值" do while not rs.eof print( rs("c_no")) select c_no from table where p_no='"& rs("c_no") &"' do while not rs.eof ... rs.movenext loop rs.movenext loop 最多循环五次
自己试着写,请各位帮忙看看,有哪些问题不? private sub recurs(p_no as string) ... '链接数据库 select c_no from table where p_no='p_no' if rs.eof then print rs("c_no") else do while not rs.eof print( rs("c_no")) recurs(rs("c_no")) rs.movenext loop end if
level = len(c_no) - 1
就可以了。
select c_no from table where p_no="输入值"
do while not rs.eof
print( rs("c_no"))
select c_no from table where p_no='"& rs("c_no") &"'
do while not rs.eof
...
rs.movenext
loop
rs.movenext
loop 最多循环五次
private sub recurs(p_no as string)
... '链接数据库
select c_no from table where p_no='p_no'
if rs.eof then
print rs("c_no")
else
do while not rs.eof
print( rs("c_no"))
recurs(rs("c_no"))
rs.movenext
loop
end if