日期:2014-05-17  浏览次数:20762 次

asp 怎么分页批量修改数据??
Set Rs = DB("Select ID,Title From Content Order By ID Desc",1)
If Rs.Eof Then Response.Write "<font color=red>没有更新。</font>" : Response.End
Do While Not Rs.Eof
Call cn_split(rs(1), 4)
Rs.MoveNext
loop
Function cn_split(str,x)
Dim a,b 
Dim i,temp_str
b = TxtContent
a=0
Arr = Split(b,"','")
temp_str=""
For i=0 To UBound(Arr)
If len(str)>len(replace(str,Arr(i),"")) Then
If len(temp_str)=len(replace(temp_str,Arr(i),"")) Then
If temp_str<>"" Then
If a<6 Then
a=a+1
temp_str=temp_str&","&Arr(i)
End If
Else
a=a+1
temp_str=Arr(i)
End If
End If
End If
Next
response.Write "文章ID:"&rs(0)&"标题:"&rs(1)&"</br>"
response.Write ""&temp_str&"</br>——————————————————————————————</br>"
End Function
Rs.close : Set Rs = Nothing

因数据太多 单页执行容易卡死,

怎么能够让上面的程序 分页执行

求高手 帮忙加段分页代码

------解决方案--------------------
where
------解决方案--------------------
方法一:首先你要传入一个Page的变量,用来显示你所要求的那一页,以及每页显示多少条PageSize,然后更改查询语句:
Select top "& PageSize &" ID,Title From Content where ID<(select min(ID) from(select top "& (Page-1)*PageSize) &" from Content) as #temp) Order By ID Desc
当如果Page为第一页时,直接Select top "& PageSize &" ID,Title From Content Order By ID Desc
用这种方法有个要求就是ID要是唯一键。

方法二:rs.PageSize,rs.PageCount的方法,百度一下有很多