asp롸女돨寧몸잚

2018-09-06 13:00

阅读:375

  asp롸女돨寧몸잚
瞳50,000係션쩌苟꿎桿법,醵똑궐ado돨컸몸狼우뜩죄

<%

************************************************************************************
야竟痰랬
DimstrDbPath
Dimconnstr
Dimmp
Setmp=NewMyPage
strDbPath=fenye/db.mdb
connstr=Provider=Microsoft.Jet.OLEDB.4.0;DataSource=
connstr=connstr&Server.MapPath(strDbPath)
conn.openconnstr
setrs=mp.Execute(select*fromtable1,conn,29)
whilenotrs.eof
response.writers(aaaa)&<br>
rs.MoveNext
wend
mp.pageDispaly()
************************************************************************************
ClassMyPage
privateMyPage_Conn,MyPage_StrSql,MyPage_TotalStrSql,MyPage_RS,MyPage_TotalRS
privateMyPage_PageSize
privateMyPage_PageAbsolute,MyPage_PageTotal,MyPage_RecordTotal
privateMyPage_Url
publicpropertyletconn(strConn)
setMyPage_Conn=strConn
endproperty

publicpropertyletPageSize(intPageSize)
MyPage_PageSize=Cint(intPageSize)
endproperty

publicfunctionPageExecute(strSql)
MyPage_PageAbsolute=MyPage_PageAbsoluteRequest()
MyPage_TotalStrSql=FormatMyPage_TotalStrSql(strSql)
setMyPage_TotalRS=MyPage_Conn.execute(MyPage_TotalStrSql)
MyPage_RecordTotal=MyPage_TotalRS(total)
MyPage_PageTotal=Cint(MyPage_RecordTotal/MyPage_PageSize)
MyPage_StrSql=FormatMyPage_StrSql(strSql)
setMyPage_RS=MyPage_Conn.execute(MyPage_StrSql)
dimi
i=0
whilenotMyPage_RS.eofandi<(MyPage_PageAbsolute-1)*MyPage_PageSize
i=i+1
MyPage_RS.MoveNext
wend
setPageExecute=MyPage_RS
endfunction

publicfunctionExecute(strSql,strConn,intPageSize)
conn=strConn
PageSize=intPageSize
setExecute=PageExecute(strSql)
endfunction

publicfunctionpageDispaly()
MyPage_Url=ReadMyPage_Url
firstPageTag=<fontface=webdings>9</font><<
LastPageTag=<fontface=webdings>:</font>>>
previewPageTag=<fontface=webdings>7</font><<
nextPageTag=<fontface=webdings>8</font>>>
dimstrAnd
ifinstr(MyPage_Url,?)=0then
strAnd=?
else
strAnd=&
endif
response.write<tablewidth=100%border=0cellspacing=0cellpadding=0>
response.write<tr>
response.write<tdalign=left>
response.write女늴:&MyPage_PageAbsolute&/&MyPage_PageTotal&女&nbsp
response.write寮痙鑒:&MyPage_RecordTotal
response.write</td>
response.write<tdalign=right>
response.write롸女:
ifMyPage_PageAbsolute>10then
response.write<ahref=&MyPage_Url&strAnd&MyPage_PageNo=1>&firstPageTag&</a>
response.write<ahref=&MyPage_Url&strAnd&MyPage_PageNo=&(MyPage_PageAbsolute-10)&>&previewPageTag&</a>
else
response.writefirstPageTag
response.writepreviewPageTag
endif
response.write&nbsp
dimCurrentStartPage,i
i=1
CurrentStartPage=(Cint(MyPage_PageAbsolute)\10)*10+1
ifCint(MyPage_PageAbsolute)mod10=0then
CurrentStartPage=CurrentStartPage-10
endif
whilei<11andCurrentStartPage<MyPage_PageTotal+1
ifCurrentStartPage<10then
FormatCurrentStartPage=0&CurrentStartPage
else
FormatCurrentStartPage=CurrentStartPage
endif
response.write<ahref=&MyPage_Url&strAnd&MyPage_PageNo=&CurrentStartPage&>&FormatCurrentStartPage&</a>&nbsp
i=i+1
CurrentStartPage=CurrentStartPage+1
wend
ifMyPage_PageAbsolute<(MyPage_PageTotal-10)then
response.write<ahref=&MyPage_Url&strAnd&MyPage_PageNo=&(MyPage_PageAbsolute+10)&>&nextPageTag&</a>
response.write<ahref=&MyPage_Url&strAnd&MyPage_PageNo=&MyPage_PageTotal&>&LastPageTag&</a>
else
response.writenextPageTag
response.writeLastPageTag
endif
response.write
response.write</td>
response.write</tr>
response.write</table>
endfunction

publicfunctionGetPageNo()
GetPageNo=cint(MyPage_PageAbsolute)
endfunction

publicfunctionGetPageCount()
GetPageCount=cint(MyPage_PageTotal)
endfunction

publicfunctionGetPageNoName()
GetPageNoName=MyPage_PageNo
endfunction

publicfunctionGetPageSize()
GetPageSize=MyPage_PageSize
endfunction

publicfunctionGetRecordTotal()
GetRecordTotal=MyPage_RecordTotal
endfunction



privatefunctionFormatMyPage_TotalStrSql(strSql)
FormatMyPage_TotalStrSql=selectcount(*)astotal
FormatMyPage_TotalStrSql=FormatMyPage_TotalStrSql&Mid(strSql,instr(strSql,from))
FormatMyPage_TotalStrSql=Mid(FormatMyPage_TotalStrSql,1,instr(FormatMyPage_TotalStrSql&orderby,orderby)-1)
endfunction

privatefunctionFormatMyPage_StrSql(strSql)
FormatMyPage_StrSql=replace(strSql,select,selecttop&(MyPage_PageAbsolute*Cint(MyPage_PageSize)))
endfunction

privatefunctionMyPage_PageAbsoluteRequest()
ifrequest(MyPage_PageNo)=then
MyPage_PageAbsoluteRequest=1
else
ifIsNumeric(request(MyPage_PageNo))then
MyPage_PageAbsoluteRequest=request(MyPage_PageNo)
else
MyPage_PageAbsoluteRequest=1
endif
endif
endfunction

privatefunctionReadMyPage_Url()
ReadMyPage_Url=Request.ServerVariables(URL)
ifRequest.QueryString<>then
ReadMyPage_Url=ReadMyPage_Url&?&Request.QueryString
endif
setre=newRegExp
re.Pattern=[&?]MyPage_PageNo=\d+?
re.IgnoreCase=true
re.multiLine=true
re.global=true
SetMatches=re.Execute(ReadMyPage_Url)
ForEachMatchinMatches
tmpMatch=Match.Value
ReadMyPage_Url=replace(ReadMyPage_Url,tmpMatch,)
next
endfunction
endClass

%>



评论


亲,登录后才可以留言!