当前位置: 代码迷 >> ASP >> 这个SQL语句写解决思路
  详细解决方案

这个SQL语句写解决思路

热度:244   发布时间:2012-03-16 16:34:56.0
这个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)
  相关解决方案