<%
page=request.QueryString("page")
if page="" then
page=1
end if
Set conn_inc=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("a.mdb")+";DRIVER={Microsoft Access Driver (*.mdb)};"
Conn_inc.Open connstr
sql=" select * from a where a='5' "
set rs=conn_inc.execute(sql)
a=rs("b")
lo=len(a)
num=cint(lo/50)+1
response.Write("文章共"&lo&"个字,分"&num&"页显示,每页50个字<br>")
if lo>50 then
temp=mid(a,50*(page-1)+1,50)
response.Write(temp)
response.Write(num)
response.Write("<br>")
for i=1 to num%>
<a href="fy.asp?page=<%= i %>"><%= i %></a>
<%
next
else
response.Write(a)
end if
%>
Do While T_Loop '这里loop多次,每4000分一页,算出页码并加入库。
If B_Len > 4000 then
N_Body = Left(I_Body,4000) 'N = New
'If "<P" in N_Body,Else ">" in N_Body
If Instrrev(N_Body,"<P") > 0 and (Len(N_Body) - Instrrev(N_Body,"<P"))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body,"<P")-1)
else if Instrrev(N_Body," ") > 0 and (Len(N_Body) - Instrrev(N_Body," "))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body," ")-1)
Else If Instrrev(N_Body,"。") > 0 and (Len(N_Body) - Instrrev(N_Body,"。"))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body,"。"))
Else If Instrrev(N_Body,";") > 0 and (Len(N_Body) - Instrrev(N_Body,";"))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body,";"))
else if Instrrev(N_Body,",") > 0 and (Len(N_Body) - Instrrev(N_Body,","))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body,","))
else if Instrrev(N_Body,".") > 0 and (Len(N_Body) - Instrrev(N_Body,"."))< 400 then
N_Body = Left(N_Body,InstrRev(N_Body,"."))
end if
end if
End If
End If
end if
End if