Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6615496
  • 博文数量: 187
  • 博客积分: 7517
  • 博客等级: 少将
  • 技术积分: 1981
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-20 18:51
文章分类

全部博文(187)

文章存档

2015年(3)

2013年(4)

2012年(20)

2011年(2)

2010年(96)

2009年(14)

2008年(47)

2007年(1)

我的朋友

分类: 系统运维

2010-06-28 19:45:31

<%
dim i,j
dim iRsCount,iRows,strpicd
dim perLines
perLines=2  '每行需显示的列数
strpicd="select * from v_web_news where c_name='"&cname2&"' and npic is not null order by id desc"
set objRs=Server.CreateObject("ADODB.RecordSet")
objRs.open strpicd,conn,1,1
if not objRs.eof then
   response.write ""&vbcrlf
   iRsCount=objRs.recordcount  '取得实际的记录数
    iRows=int(iRsCount/perLines) '计算可得到的行数
    if iRows<1 then
       iRows=1
     else      
        if iRsCount mod perLines=0 then
          iRows=int(iRsCount/perLines)
         else
          iRows=int(iRsCount/perLines)+1
        end if
    end if
   i=1
   while not objRs.eof
     for i=1 to iRows
      response.write ""&vbcrlf
      for j=1 to perLines
        If Not objRs.eof then
           'response.write ""&vbcrlf
           response.write ""&vbcrlf
        Else
           response.write ""&vbcrlf
        End if
        if not objRs.eof then objRs.movenext
      next
      response.write ""&vbcrlf
      '---
      response.write ""&vbcrlf
       response.write ""&vbcrlf
       response.write ""&vbcrlf
      response.write ""&vbcrlf
      '---
    next
  Wend
  response.write "
 
"
end if
objRs.close
set objRs=nothing
%>
阅读(1049) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~