|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
ActiveServerPage技术为应用开发商提供了基于脚本的直观、快速、高效的应用开发手段,极大地提高了开发的效果。在讨论ASP的安全性问题之前,让我们来看看ASP是怎么工作的。分页asp分页的一个类,
在50,000笔记录下测试过,速率比ado的谁人要快多了
<%
************************************************************************************
详细用法
Setconn=Server.CreateObject("ADODB.Connection")
conn.open"DRIVER={SQLServer};SERVER=(local);UID=sa;PWD=1230;DATABASE=Music"
setrs=mp.Execute("select*fromMusicList",conn,29)
whilenotrs.eof
response.writers2("MusicName")&"<br>"
rs2.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&"页 "
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"<a
href="&MyPage_Url&strAnd&"MyPage_PageNo="&(MyPage_PageAbsolute-10)&">"&previewPageTag&"</a>"
else
response.writefirstPageTag
response.writepreviewPageTag
endif
response.write" "
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"<a
href="&MyPage_Url&strAnd&"MyPage_PageNo="&CurrentStartPage&">"&FormatCurrentStartPage&"</a> "
i=i+1
CurrentStartPage=CurrentStartPage+1
wend
ifMyPage_PageAbsolute<(MyPage_PageTotal-10)then
response.write"<a
href="&MyPage_Url&strAnd&"MyPage_PageNo="&(MyPage_PageAbsolute+10)&">"&nextPageTag&"</a>"
response.write"<a
href="&MyPage_Url&strAnd&&</p>帮助用户快速实现各种应用服务,ASP商有整合各方面资源的能力,可在短期内为用户提供所需的解决方案。例如,典型的ERP安装,如果要在客户端安装的话需要半年到二年的时间,但是美国的一些ASP商如USI和CORIO能在90—120天内提供ERP应用方案。 |
|