asp分列问题,求解.请把改好的代码贴出,加分

2025-04-15 16:31:00
推荐回答(2个)
回答1:

Dim Infolist,mpage,allshu,TL,PageList,rs_type
Set Rs=Conn.Execute("select id,tid,Html,title,Hits,Inputdate from "&Table_Pre&"_info where tid in("&sid&") order by inputdate desc,id desc")
if rs.eof then
response.write "对不起! 暂时没有相关文章 @_@" '去掉从循环
mpage=1
allshu=0
else
'rs.pagesize=Display '得到每页数
'mpage=rs.pagecount '得到总页数
rs.move (currentPage-1)*Display
'allshu=rs.recordcount
allshu=total

mpage=clng(allshu/Display)

h=0
do while not rs.eof
h=h+1
TL=Split(rs("Html"),"/") '这个不知道什么意思,建议不要
response.write ""'单无格开始
'显示内容开始(如果想让显示内容表格化,可以再这里开始个新


response.write ""&Navpic&""
'若不想文章标题前有[]形式的所属分类名,则注释掉下面6行代码至rs_type.close
'set rs_type=server.CreateObject("ADODB.RecordSet")
'rs_type.open "select Tname,Ename from "&Table_Pre&"_Class where id="&rs("tid"),conn,1,1
'if not rs_type.EOF then
'TN=split(rs_type("tname"),"|")
'infolist=infolist&"["&TN(ubound(TN)-1)&"]"
'end if
'rs_type.close
response.write " "&Leftstr(rs("title"),46)&"
"
response.write ""&DateTimeFormat(rs("inputdate"),1)&""
response.write ""&rs("hits")&""
'显示内容结束
response.write "" '单元格结束
if (h mod 4)=0 then infolist=infolist&"" '如果被4整除从新开始一行
if h>=Display then exit do
rs.movenext
loop
end if
rs.close
response.write "
"&infolist&"
"
set rs=nothing

回答2:

什么分列,分页?