关于select嵌套查询问题 为了从数据库分别列出部门列表和各部门员工的名单,建立了一个部门表,一个员工表,

---------------------------------------------------------------

sqlstr= "select * from 部门表名"
set rs=conn.execute(conn)
dim typeNam(20)
do while not rs.eof
typeNam(i)=rs("Office")
sqlstr2="select * from 员工表名 where office="&typeNam(i)
set rs1=conn.execute(sqlstr2)
do while not rs1.eof
..........
rs.movenext
loop
rs.movenext
loop

---------------------------------------------------------------

rs.open sqlstr,conn,1,1
不支持rs.recordcount
该为
rs.open sqlstr,conn,3,3

Published At
Categories with Web编程
Tagged with
comments powered by Disqus