vb 高手帮帮忙,我不用数组~
Function ChannelCount(sChannelID,sType)Cl.Load_ChannelSetting(sChannelID)
Dim rsCount(2) as integer,ModuleName
Select Case CLng(Cl.Channel.selectSingleNode("@moduleid").text)
Case 1 : ModuleName = "Article"
Case 2 : ModuleName = "Soft"
Case 3 : ModuleName = "Photo"
Case 4 : ModuleName = "Movie"
Case 5 : ModuleName = "Product"
Case Else : ModuleCount = 0 : Exit Function
End Select
Select Case sType
Case 0
Set rsCount(0) = Cl.Execute("select count(InfoID) from Cl_"&ModuleName&" where ChannelID="&sChannelID&" and Deleted="&FalseType)
Set rsCount(1) = Cl.Execute("select sum(Hits) from Cl_"&ModuleName&" where ChannelID="&sChannelID&" and Deleted="&FalseType)
Case 1
Set rsCount(0) = Cl.Execute("select count(InfoID) from Cl_"&ModuleName&" where ChannelID="&sChannelID&" and Status=1 and Deleted="&FalseType)
Set rsCount(1) = Cl.Execute("select sum(Hits) from Cl_"&ModuleName&" where ChannelID="&sChannelID&" and Status=1 and Deleted="&FalseType)
Case 2
Set rsCount = Cl.Execute("select count(InfoID) from Cl_"&ModuleName&" where ChannelID="&sChannelID&" and Status=0 and Deleted="&FalseType)
Case 3 '===(3) 阅读
Set rsCount = Cl.Execute("select sum(Hits) From Cl_"&ModuleName&" where ChannelID="&sChannelID&" ")
Case 4 '===(4) 评论总数
Set rsCount = Cl.Execute("select count(CommentID) from Cl_Comment where ChannelID="&sChannelID&"")
Case 5 '===(5) 已审评论
Set rsCount = Cl.Execute("select count(CommentID) from Cl_Comment where ChannelID="&sChannelID&" and Status=1")
Case 6 '===(6) 待审评论
Set rsCount = Cl.Execute("select count(CommentID) from Cl_Comment where ChannelID="&sChannelID&" and Status=0")
Case 7 '===(7) 专题总数
Set rsCount = Cl.Execute("select count(SpecialID) from Cl_Special where ChannelID="&sChannelID&"")
Case Else
ChannelCount = 0 : Exit Function
End Select
ChannelCount = rsCount()
rsCount.Close : Set rsCount = Nothing
End Function
帮忙看看,我只改了两个case条件,其他的case条件不用管。可是不能显示结果,请大家看看帮帮忙~我加颜色的地方是不是有哪儿不对了