高手们看一下这种ASP语句有没有错

来源:百度知道 编辑:UC知道 时间:2024/06/09 06:28:42
Set thirrs=Server.CreateObject("ADODB.Recordset")
thirsql="SELECT COUNT(*)AS thircount FROM news_Class_3 WHERE typeid="&rstype("typeid")
thirrs.Open thirsql,conn,1,1
If not thirrs.Eof Then
If thirrs("thircount")<=0 Then
seCount_sale=""
Else
seCount_sale="(<font color=red>"&thirrs("thircount")&"</font>)"
End If
thirrs.close
Set thirrs=Nothing
End If

为什么我得到的永远是seCount_sale="" 是那哪里写错了吗?还是什么原因??
先谢谢高手的解答,最好详细点.

news_Class_3是不是空的?

Set thirrs=Server.CreateObject("ADODB.Recordset")
thirsql="SELECT COUNT(*)AS thircount FROM news_Class_3 WHERE typeid="&rstype("typeid")
thirrs.Open thirsql,conn,1,1
If not thirrs.Eof Then
If thirrs("thircount")<=0 Then
seCount_sale=""
Else
seCount_sale="(<font color=red>"&thirrs("thircount")&"</font>)"
End If
End If
thirrs.close
Set thirrs=Nothing