zoukankan      html  css  js  c++  java
  • 从第二条开始提取数据库中的信息

    function Newstop2(SortPath)
      dim rs,sql,NewsName,NewFlag
      set rs = server.createobject("adodb.recordset")
      sql="select top 4 * from Qianbo_News where Instr(SortPath,'"&SortPath&"')>0 order by id desc"
      rs.open sql,conn,1,1
      if rs.eof then
          Response.Write " 暂无相关信息"&VbCrLf
      else
      rs.movenext
        do while not rs.eof  
       if now()-rs("AddTime")<=2 then
         NewsName=StrLeft(rs("NewsName"),20)  
         NewFlag=""
       else
         NewsName=StrLeft(rs("NewsName"),20)  
         NewFlag=""
       end If
      If ISHTML = 1 Then
       AutoLink = ""&NewName&""&Separated&""&rs("ID")&"."&HTMLName&""
      Else
       AutoLink = "NewsView.asp?ID="&rs("id")&""
      End If
      Response.Write "<li style=""height:20px"">&nbsp;<a href="""&AutoLink&""">"&NewsName&"</a></li>"
          rs.movenext
        loop
      end if
      rs.close
      set rs=nothing
    end Function
    
     
    
    注:rs.movenext     从当前位置向下移动一行
    
        rs.moveprevious 从当前位置向上移动一行
  • 相关阅读:
    IntelliJ IDEA基本设置
    git安装
    Git的作用与安装
    git是什么
    SpringMVC控制器类方法的返回值
    SpringMVC中Model机制
    什么是Nosql
    如何使用Jedis操作redis
    redis中数据类型操作命令
    redis的全局命令
  • 原文地址:https://www.cnblogs.com/liuswi/p/2754670.html
Copyright © 2011-2022 走看看