急求无效使用 Null: 'Replace'的解决办法
以下是程序代码
<%
'新闻排行
'ClassID类别ID
'NewNum新闻条数
'TitleLen标题字符长度
'OrderType排序类型:0-日排行,1周排行,2月排行
sub NewsListOrderBy(ClassID,NewNum,TitleLen,OrderType)
dim whereString
sql = "select top " & NewNum & " htmlPath,title,Hits from ["& Cfg.tablePrefix &"news]"
if ClassID = "" then
sql = sql & " where isRec = 0 and isSign = 1"
else
sql = sql & " where classId = " & ClassID & " and isRec = 0 and isSign = 1"
end if
Select Case OrderType
Case 0
whereString = "and datediff(hour,createDate,getDate()) < 24"
Case 1
whereString = "and DATEPART(wk, createDate) = DATEPART(wk, GETDATE()) and DATEPART(yy, createDate) =
DATEPART(yy, GETDATE())"
Case 2
whereString = "and datediff(m,getdate(),createDate)=0"
End Select
sql = sql & whereString
sql = sql & " order by Hits desc"
rs = dbo.query(sql)
if isnull(rs) or isempty(rs) then
response.Write("暂无数据")
else
for i = 0 to ubound(rs,2)
htmlPath = rs(0,i)
title = rs(1,i)
Hits = rs(2,i)
(错误行) htmlPath = replace(htmlPath,"/news/","")
%>
<tr>
<td width="20" align="middle" > <img src="images/0731_t <%=i+1%>.gif" width="15" height="14" /> </td>
<td height="24" align="left"> <a href=" <%= htmlPath %>" title=" <%= title %>" target="_blank"> <% =
lib.cut_Title(title,TitleLen) %> </a> </td>
<td width="30"> <% = Hits %> </td>
</tr>
<%
next
end if
set rs = nothing
end sub
%>
在站里也看了相关的帖子,但本人asp水平有限,具体的如何解决还请各位老师多多帮助,在这里谢过大家了。