这个SQL语句写解决思路

这个SQL语句写统计记录数保存到参数depcount。select count(*) from Department完整代码要怎么写?Set rsSe

这个SQL语句写
统计记录数保存到参数depcount。
select count(*) from Department

完整代码要怎么写?

Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select count(*) from Department where ParentID="&parid


depcount=conn.Execute(sql)

是这样吗?

[解决办法]
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select count(*) from Department where ParentID="&parid


depcount = conn.Execute(sql)(0)