各位大虾看看这有什么问题
function ShowNewArticle1(ArticleNum,TitleLen,ClassID,caname)dim sqlNew,rsNew,strrow,strcol,i,tmpdata
dim sqlRoot,rsRoot,trs,arrClassID,TitleStr
nt2003.Name=caname
sqlRoot="select * From ArticleClass where ParentID=" & ClassID & ""
Set rsRoot= Server.CreateObject("ADODB.RECORDSET")
rsRoot.open sqlRoot,conn,1,1
arrClassID=ClassID
do while not rsRoot.eof
arrClassID=arrClassID & "," & rsRoot(0)
rsRoot.movenext
loop
rsRoot.close
set rsRoot=nothing
sqlNew="select top 20 A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,A.ReadLevel,L.LayoutFileName from article A inner join Layout L on L.LayoutID=A.LayoutID where A.Deleted=False and A.Passed=True"
if instr(arrClassID,",")>0 then
sqlNew=sqlNew & " and A.ClassID in (" & arrClassID & ") order by A.articleid desc"
else
sqlNew=sqlNew & " and A.ClassID=" & Clng(arrClassID) & " order by A.articleid desc"
end if
Set rsNew = nt2003.execute(sqlNew)
if rsNew.bof and rsNew.eof then
nt2003.value=""
else
nt2003.value = rsNew.GetString(,,"|||","@@@","")
end if
rsNew.close
set rsNew=nothing
if TitleLen<0 or TitleLen>255 then TitleLen=50
if nt2003.value="" then
tmpdata = "<font color=#ff9900>·&nbsp;</font>没有任何文章"
else
strrow=Split(nt2003.value,"@@@")
dim loopnum
if ArticleNum<UBound(strrow) then
loopnum=ArticleNum-1
else
loopnum=UBound(strrow)-1
end if
for i = 0 to loopnum
strcol=Split(strrow(i),"|||")
if strcol(5)=>Userlevel then
tmpdata = tmpdata & "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td width=100% ><font color=#ff9900>·&nbsp;</font><a href='" & strcol(6) & "?ArticleID=" & strcol(0) &"' title='文章标题:" & strcol(1) & vbcrlf & "文章作者:" & strcol(2) & vbcrlf & "更新时间:" & strcol(3) & vbcrlf & "点击次数:" & strcol(4) & "' target='_blank'>" & gotTopic(strcol(1),TitleLen) & "</a>"
if datediff("d",strcol(3),date())<2 then 'By一枝梅
tmpdata = tmpdata & "<font color=#FF0000>&nbsp;New</font>"
end if 'By一枝梅
tmpdata = tmpdata & "</td></tr></table>"
end if
next
end if
ShowNewArticle1=tmpdata
end function