楼上说的对或者用一个变量接收也可以dim aa as integer aa=rst.fields("aaa")
同意用 rst.Open "select count(*) as aaaa from 表2 where 巡检员姓名='gaobo'", cn, adOpenDynamic, adLockBatchOptimistic text1.text=rst.fields("aaa")
rst.Open "select count(*) as sum from 表2 where 巡检员姓名='gaobo'", cn, adOpenDynamic, adLockBatchOptimisticdim Intsum as integer Intsum=rst.fields("sum").vlaues
rst.Open "select count(*) as sum from 表2 where 巡检员姓名='gaobo'", cn, adOpenDynamic, adLockBatchOptimisticdim Intsum as integerIntsum=rst.fields("sum").values
aa=rst.fields("aaa")
rst.Open "select count(*) as aaaa from 表2 where 巡检员姓名='gaobo'", cn, adOpenDynamic, adLockBatchOptimistic
text1.text=rst.fields("aaa")
Intsum=rst.fields("sum").vlaues