ZDNetChina中文社区 » Web开发 » 读取一access电影数据库中最新50部电影的小函数,为什么会全部读出来?


2008-4-28 14:15 carefree1004
读取一access电影数据库中最新50部电影的小函数,为什么会全部读出来?

----变量申明   
  dim   strTitle,strAll_Update,strSite_Info,strAllDownTop,strWeekDownTop,strDayDownTop,strNewsJpzt,strNewsCode,strNewsQq,strNewsCommend,strNewsVir,strCatalog1,strCatalog2,strCatalog3,strCatalog4,strCatalog5,strCatalog6,strCatalog7,strCatalog8,strCatalog9,strCatalog10,strCatalog11,strCatalog12,strCatalog13,strSite_Link_Text,strSite_Link_Logo,strMessages,strimages_Update,images_Update123   
   
  '----变量赋值   
   
  strSite_Info=Site_info()   
  strLeft=get_AllTop(0,30,17,0,0)   
  strCenter=get_update(26,50,7,1)   
  HtmlContent=HtmlTemplate   
                HtmlContent=replace(HtmlContent,"$Site_info$",""&strSite_info&"")   
  HtmlContent=replace(HtmlContent,"$Center$",""&strCenter&"")     
  HtmlContent=replace(HtmlContent,"$Left$",""&strLeft&"")     
  HtmlContent=replace(HtmlContent,"../","./")   
  HtmlContent=replace(HtmlContent,"</HEAD>","</HEAD>"&Copyright&"")   
  HtmlFileName=Server.MapPath("../default.htm")   
  Set   fout   =   fso.CreateTextFile(HtmlFileName)   
          fout.WriteLine   HtmlContent     
          fout.close:set   fout   =   nothing     
  end   sub   
  ///////////////   
  这是创建页面的   
  //////////////////   
   
   
  ////////////////////////////////////////////   
   
  下面是函数定义   
  /////////////////////////////////   
  '****************************************************************************************   
  '最近更新调用系列函数   
  '****************************************************************************************   
  '最近更新   
  function   get_update(topNum,cutNum,showTime,isRoot)   
  dim   strDateTime,strSoftName   
  sql="select   top   "&topNum&"   *   from   SoftDown_SoftInfo   where   isdel=0   order   by   SoftTime   desc"   
  Rs.open   sql,conn,1,1     
  if   Rs.eof   and   Rs.bof   then     
  get_update   =   get_update   &   "     <tr>"&   vbcrlf   
  get_update   =   get_update   &   "         <td>对不起,该分类暂时没有任何电影。</td>"&   vbcrlf   
  get_update   =   get_update   &   "     </tr>"&   vbcrlf   
  else   
  do   while   not   Rs.eof     
  if   showTime=0   then   
  strDateTime=""   
  else   
  strDateTime=FormatDateTime(Rs("SoftTime"),2)   
  end   if   
  if   rs("Rank")=1   then   
  strRank=   "★"   
  end   if   
  if   rs("Rank")=2   then   
  strRank="★★"   
  end   if   
  if   rs("Rank")=3   then   
  strRank="★★★"   
  end   if   
  if   rs("Rank")=4   then   
  strRank="★★★★"   
  end   if   
  if   rs("Rank")=5   then   
  strRank="★★★★★"   
  end   if   
  get_update   =   get_update   &   "   <tr>"&   vbcrlf   
  get_update   =   get_update   &   "<td   height=2   colspan=6   background=htmlimages/line.gif></td>"&   vbcrlf   
  get_update   =   get_update   &   "</tr>"&   vbcrlf   
  get_update   =   get_update   &   "     <tr>"&   vbcrlf   
  get_update   =   get_update   &   "     <td   width=25   height=22><IMG   height=21   src=htmlimages/joke-topbs.jpg   width=25></td>"&   vbcrlf   
  get_update   =   get_update   &   "     <td   width=300   height=22><A   href=SoftView/SoftView_"&Rs("SoftID")&".html   title="&Rs("SoftName")&"   target=_blank>"&cutStr(Rs("SoftName"),cutNum)&"</a></td>"&   vbcrlf   
  get_update   =   get_update   &   "     <td   width=55   height=22   align=center><a   href=""../SoftList/Catalog_"&rs("CatalogID")&"_SoftTime_Desc_1.html"">"&rs("CatalogName")&"</a></td>"&   vbcrlf   
  get_update   =   get_update   &   "     <td   width=55   height=22   align=center>"&rs("AllHits")&"</td>"&   vbcrlf   
  get_update   =   get_update   &   "     <td   width=75   height=22   align=center><FONT   color=#111111>"&strDateTime&"</FONT></td>"&   vbcrlf   
  get_update   =   get_update   &   "     <td   width=95   height=22   align=center><FONT   color=#009900>"&strRank&"</font></td>"&   vbcrlf   
  get_update   =   get_update   &   "     </tr>"&   vbcrlf   
  Rs.movenext   
  loop     
  end   if   
  Rs.close   
  end   function   
   
   
   
  //////////////////////////////////   
  在首页模版中是以   
  $Site_info$   
  $Center$   
  等这样的形式调用的   
  别的都好,为什么就是最近更新的影片数量不是定义的50个,而是全部?   
  那里有错啊?

页: [1]


Powered by Discuz!  Archiver   © 2001-2006 Comsenz Inc.