用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 是 细表中有多少对应的记录

解决方案 »

  1.   

    假如主表table_a字段:ID,A,B,SERIAL 主键ID
        子表字段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
      

  2.   

    定义ADODC.RECORDSET对象,如:rs。使用rs.open打开数据库表格。使用rs.recordcount就可以知道表中的记录个数。
    笨笨
      

  3.   

    dear ! 请先建立一个主细表的视图---view
    step 1    str = "select * from view"
    step 2    rs.open str,cnn ……
    step 2    rs.recordcount
      

  4.   

    do until rst.eof
     a=a+1
     rst.movenext
    loop