If RecordCount Mod PageSize <> 0 Then
pages = 1
else
pages = 0
End If
PageCount=CInt(RecordCount/PageSize + pages)
parms=Array(RecordCount)
lRecordCount = Format(C_RECORDCOUNT,parms)
if CInt(CurrentPage)>1 Then
parms=Array(Pageurl,1)
lFirstpage = Format(C_FIRSTPAGE1,parms)
parms=Array(Pageurl,CInt(CurrentPage)-1)
lPrevpage = Format(C_PREVPAGE1,parms)
Else
lFirstpage=C_FIRSTPAGE2
lPrevpage=C_PREVPAGE2
End If
if CInt(CurrentPage)<PageCount Then
parms=Array(Pageurl,CInt(CurrentPage)+1)
lNextpage = Format(C_NEXTPAGE1,parms)
parms=Array(Pageurl,CInt(CurrentPage)+1)
lLastpage = Format(C_LASTPAGE1,parms)
Else
lNextpage=C_NEXTPAGE2
lLastpage=C_LASTPAGE2
End If
parms=Array(CurrentPage,PageCount)
lCurrentpage = Format(C_CURRENTPAGE,parms)
parms=Array(PageSize)
lPagesize = Format(C_PAGESIZE,parms)
parms=Array(Pageurl,CurrentPage)
lGotopage = Format(C_GOTOPAGE,parms)
p=lRecordCount&lFirstpage&lPrevpage&lNextpage&lLastpage&lCurrentpage&lPagesize&lGotopage
Page = p
End Function
End Class
%>
AccHelper.asp
<%
''/// <summary>
''/// AccHelper 的摘要说明。
''/// </summary>
Class AccHelper
Public CONN_STRING
''/// <summary>
''/// 执行ExecuteNonQuery
''/// </summary>
''/// <param name="connString">连接字符</param>
''/// <param name="cmdText">sql命令</param>
Public Function ExecuteNonQuery(connString,cmdText)
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open connString
objConn.Execute(cmdText)
End Function
''/// <summary>
''/// 执行ExecuteReader
''/// </summary>
''/// <param name="connString">连接字符</param>
''/// <param name="cmdText">sql命令</param>
''/// <returns>RS</returns>
Public Function ExecuteReader(connString,cmdText)
Dim objConn,objRS
Set objConn = Server.CreateObject("ADODB.Connection")