<%
Function CountWhere(TableName,WhereStr,Con)
Dim rsCount
Dim CountNum
Set rs=Con.execute("Select Count(*) As Cnt from "&TableName&" where "&WhereStr)
CountNum=rs("Cnt")
CountWhere=CountNum
End Function
'用法
Dim CntNum
CntNum=CountWhere("a","a_bb=1",con)
Response.Write("a_bb=1的数据有"&CStr(CntNum)&"条")
%>