📄 cls_db.asp
字号:
<%
dim conn,rst
function openDB
Set conn = Server.CreateObject("ADODB.Connection")
rst="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("TP.mdb")
conn.Open rst
end function
function closeDB
conn.close
set conn=nothing
end function
REM 分页显示
function page(allpages,viewpage,pageURL,pp)
if int(allpages)=0 then
page="<font color=red >[1]</font>"
exit function
end if
dim pn,pi,page_num,ppp,pl,pr:pi=1:ppp=pp\2
if pp mod 2 = 0 then ppp=ppp-1
pl=viewpage-ppp:pr=pl+pp-1
if pl<1 then
pr=pr-pl+1:pl=1
if pr>allpages then pr=allpages
end if
if pr>int(allpages) then
pl=pl+allpages-pr:pr=allpages
if pl<1 then pl=1
end if
if pl>1 then
response.write page&" <a href='"& pageURL &"' title='第一页'>[|<]</a> <a href='"& pageURL &"?pageno="&pl-1&"' clases=706501 title='上一页'>[<]</a> "
end if
for pi=pl to pr
if cint(viewpage)=cint(pi) then
response.write page&" <font color=red>[" & pi & "]</font> "
else
response.write page&" <a href='"& pageURL &"?pageno="& pi &"' title='第 " & pi & " 页'>[" & pi & "]</a> "
end if
next
if pr<allpages then
page=page&" <a href='"& pageURL &"?pageno="&pi&"' title='后一页'>[>]</a> <a href='"& pageURL &"?pageno="& allpages &"' title='最后一页'>[>|]</a> "
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -