Dim Total As New ADODB.Recordset sqlStr = "select count(表号) from (select distinct 表号 from Threemeter Where 批号='T06004')" Total = sqlCnn.Execute(sqlStr)此句报错
奇怪的是这一句竟然是正确的: str = "select count(pname) from ( select distinct pname from person where pclass ='3')" 这一句却是错误的: sqlStr = "select count(表号) from (select distinct 表号 from Threemeter Where 批号='T06004')"