用sql语句
select count(a.name) from table1 a ,table2 b where a.id =b.id and a.id =1 然后记录的得 recordset.field[0].value
就是主表中 id =1 是 细表中有多少对应的记录
select count(a.name) from table1 a ,table2 b where a.id =b.id and a.id =1 然后记录的得 recordset.field[0].value
就是主表中 id =1 是 细表中有多少对应的记录
子表字段table_b:SUBID,C,D,SERIAL 主键SUBID、SERIAL
select ff = rtrim(a.id)+ b.sub_id,a.a,a.b,b.c,b.d
from table_a a,table_b b
where b.serial = a.serial select ff = a.id,dd = count(b.serial)
from table_a a,table_b b
where b.serial = a.serial
group by a.id
笨笨
step 1 str = "select * from view"
step 2 rs.open str,cnn ……
step 2 rs.recordcount
a=a+1
rst.movenext
loop