求一个ASP+ACCESS跳转页代码

\u6c42asp+access\u4e00\u6bb5\u4ee3\u7801

\u641e\u5b9a\u4e86\uff0c\u7ed9\u5206\u5427\u3002

<%
on erro resume next '\u5bb9\u9519\u5904\u7406
dim conn,connstr
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("mark.mdb")
conn.Open connstr
if erro then '\u5982\u679c\u6570\u636e\u5e93\u8fde\u63a5\u51fa\u9519
erro.clear '\u6e05\u9664\u51fa\u9519\u4fe1\u606f
response.write("\u6570\u636e\u5e93\u8fde\u63a5\u51fa\u9519\uff0c\u8bf7\u68c0\u67e5\u6570\u636e\u5e93\u8def\u5f84\u662f\u5426\u6b63\u786e\uff01")]
response.end()
end if
sub endconn() '\u5b9a\u4e49\u4e00\u4e2a\u5173\u95ed\u8fde\u63a5\u7684\u8fc7\u7a0b
conn.close
set conn=nothing
end sub
%>
\u5728\u5176\u4ed6\u4e5f\u9762\u5c31\u76f4\u63a5\u7528



...
..

<%
call endconn()
%>

<!--#include file="top.asp"-->
<script language="JavaScript">
function Listbox1_HuLiguo1(Listbox1_url){
location=Listbox1_url;
for(var i=0;i<document.Listbox1.elements.length;i++){
document.Listbox1.elements[i].options[0].selected=true
}
}
//-->
</script>

<%
ServerName = Request.ServerVariables("SERVER_NAME")
Typeid = Request.QueryString("typeid")

If Typeid = "成人专辑" Then
If ServerName = "192.168.1.251" then
Response.Write ("<script>alert(' 建设中……');javascript:history.go(-1);</script>")
Response.end
If Hour(time) > 6 and Hour(time) < 22 Then
Response.Write ("<script>alert(' 错误!\n\n未经授权的访问。');javascript:history.go(-1);</script>")
Response.end
End if
Else
If Request.Cookies("UserName")="" or Request.Cookies("UserName")=null Then
Response.Write ("<script>alert(' 错误!\n\n您还没有登陆或登陆超时,请先登陆。');javascript:history.go(-1);</script>")
Response.end
End if
End if
End if
%>
<TABLE cellPadding="0" width="100%" border="0" ID="Table14" bgcolor="#FFFFFF">
<TR>
<TD vAlign="top" width="10%">
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" ID="Table4">
<tr><td vAlign="top"><!--#include file="login.asp" --></td></tr>
</table>
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" ID="Table5">
<tr><td vAlign="top"><!--#include file="updating.asp" --></td></tr>
</table>
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" ID="Table5">
<tr><td vAlign="top"><!--#include file="recommand.asp" --></td></tr>
</table>
</TD>
<TD vAlign="top" width="1" bgColor="#cccccc"><IMG height="1" src="images/spacer.gif" width="1"></TD>
<TD width="90%" vAlign="top">
<TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
<TR>
<TD><IMG height="35" src="images/<%=typeid%>.jpg" width="262"></TD>
</TR>
<TR>
<TD Height="2"></TD>
</TR>
<TR>
<TD bgColor="#cccccc" colSpan="2"><IMG height="1" src="images/spacer.gif" width="1"></TD>
</TR>
<TR>
<%
MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages

if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql
dim rs
sql="select * from movie where typeid='"&typeid&"' and lockmovie=False order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<TR><TD align='center'><FONT color='#ff4800' size='3'><B> 该栏目没有任何电影</B></FONT></TD></TR></TABLE>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,""
showtitle
showpage1 totalput,MaxPerPage,""
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,""
showtitle
showpage1 totalput,MaxPerPage,""
else
currentPage=1
showpage totalput,MaxPerPage,""
showtitle
showpage1 totalput,MaxPerPage,""
end if
end if
end if
sub showtitle%> <tr>
<td width="100%"></td>
</tr>
<tr>
<td width="100%"><table border="0" cellpadding="0" cellspacing="1" style="border-collapse: collapse" width="99%" id="AutoNumber1" bordercolor="#6D6D6D">
<%
b=0
dim row_count
row_count=1
%>
<tr>
<%
do while not rs.eof
b=b+1%> <td width="50%" valign="top"><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr><td width="50%" colspan="2" height="8"></td></tr>
<tr>
<td width="25%"><table border="0" cellspacing="1" style="border-collapse: collapse" width="100%" id="AutoNumber1" bordercolor="#D8D8D8">
<tr>
<TD class=lightedge width=125><A href="Movie.asp?id=<%=rs("id")%>" target=_blank><img class=blackedge height=175 src=<%=rs("Pic")%> width=125 border=0></A></TD>
<TD vAlign=top>
<TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>
<TR><TD class=dottedline colSpan=2> <A href="Movie.asp?id=<%=rs("id")%>" title=<%=rs("Name")%> target=_blank><FONT color=#ff4800 size=3><B><%=rs("Name")%></B></FONT></A></TD></TR>
<TR><TD class=dottedline vAlign=top align=right width="19%"><FONT class=font_darkyellow>领衔主演:</FONT></TD>
<TD class=dottedline width="81%"><FONT class=font_gray><%=left(rs("Title"),14)%></FONT></TD></TR>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_darkgreen>导      演</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray>梦幻空间</FONT></TD></TR>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_pink>语言对白</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray>中文字幕</FONT></TD></TR>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_darkgreen>影片格式</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray>Rmvb 视频节目</FONT></TD></TR>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_pink>发布地区</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray><%=rs("Typeid")%></FONT></TD></TR>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_darkgreen>发布日期</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray><%=rs("Date")%></FONT></TD>
<TR><TD class=dottedline vAlign=top align=right><FONT class=font_darkyellow>观看次数</FONT>:</TD>
<TD class=dottedline width="81%"><FONT class=font_gray><%=rs("Hits")%></FONT></TD>
</TR>
</TABLE>
</TD>
</tr>
</table>
</td>
</tr>
<tr><td width="50%" colspan="2" height="8"></td></tr>
<TR><TD bgColor=#999999><IMG height=4 src="images/spacer.gif" width=1></TD></TR>
</tr>
</table>
</td>
<% if row_count mod 2 =0 then%></tr>
<tr>
<%end if%> <%row_count=row_count+1
if b=10 then exit do
rs.movenext
loop
rs.close
set rs=nothing

%> </tr>
</table>
</td>
</tr>
<tr>
<td width="100%" bordercolor="#00BF00">
<div align="center">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td height="20" align="left"><table border="0" cellPadding="0" cellSpacing="0" width="99%" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D8D8D8">
<tr>
<span lang="zh-cn"><td width="71%" height="18">
<%
end sub

function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
end function

function showpage1(totalnumber,maxperpage,filename)
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
Response.Write "共有影片:<font face=""arial"" color=""red"">"&totalnumber&"</font>部 当前页:<font face=""arial"" color=""red"">"&CurrentPage&"</font> 共<font face=""arial"" color=""red"">"&n&"</font>页  "
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href="&filename&"?typeid="&typeid&"&page=1&>首页</a> "
response.write "<a href="&filename&"?typeid="&typeid&"&page="&CurrentPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?typeid="&typeid&"&page="&(CurrentPage+1)
response.write ">下一页</a> <a href="&filename&"?typeid="&typeid&"&page="&n&">尾页</a>"
end if
response.write " </td>"
response.write "<form name=""Listbox1"">"
response.write "<td width=""12%"" height=""18"">"
dim n
%></TD><TD class="ChangePageClass1" align="right">选择页数</TD>
<TD class="ChangePageClass2" vAlign="bottom" align="right">
 <select name="Menu_HuLiguo2" size="1" onchange="Listbox1_HuLiguo1(document.Listbox1.Menu_HuLiguo2.options[document.Listbox1.Menu_HuLiguo2.selectedIndex].value)">
<option>第<%=CurrentPage%>页</option>
<%for j=1 to n%>
<option value="?typeid=<%=typeid%>&page=<%=j%>">第<%=j%>页</option>
<%next%></select>
<%end function%></td>
</form>
</span></tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="end.asp"-->

你不只是一般的蠢,要源代码研究,这个复制过去就可以测试了自己学着写.懒人一个

做一个跳转菜单即可

<select name="order" id="order" onchange="document.location.href='list.asp?page='+this.options[this.selectedIndex].value">

<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>

</select>
然后用程序把里边的<option value="2">2</option> 换掉即可。

提醒搂主:千万不要用DW自带做的做这些动态功能,虽然有不少图书上这么教你[那都是误人子弟]。一定要学会首先代码,否则一段时间以后你肯定会后悔的。用dw你对编程不会有任何进步,而且再以后的工作中dw根本无法应对。

既然知道上一页下一页的功能。

为什么不做一个输入框,直接让用户输入第几页,呢?假如有几百页,那你的下拉菜单就没有意义了。对不?

  • 鎴戝仛浜涓涓缃戦〉,鏄ASP鐨,鐢ㄧ殑鏁版嵁搴撴槸access鐨,銆傘
    绛旓細<a href=椤甸潰.asp?id=<%=rs("id")%>><%=rs("zuixin")%> 鍗曠函鍔犺繛鎺ョ殑璇濓紝杩欐牱灏卞彲浠ヤ簡."id="鍚庨潰鐨勬槸ID鍙,褰撶劧杩樺彲浠ュ姞鍏朵粬鐨勫弬鏁.
  • ...5椤,鎴戠殑鏁版嵁閮芥槸浠access涓惊鐜嚭鏉ョ殑,杩欑璺宠浆鎬庝箞鍋
    绛旓細妤间笂鐨勫洖绛斿熀鏈笂鏄纭殑锛屼富瑕佹濊矾灏辨槸鍦ㄦ枃鏈鍊煎彂鐢熸敼鍙樼殑鏃跺欙紝鍘昏姹涓涓URL锛屾墍闇鐨勯〉鐮佸凡缁忕紪鍦ㄨ繖涓猆RL涓簡銆傚悗鍙版敹鍒拌繖涓姹傚悗锛屾牴鎹甎RL涓殑椤电爜锛屽啀浠庢暟鎹簱鍙栧嚭鏁版嵁锛屾覆鏌撴垚椤甸潰閫佺粰瀹㈡埛銆傚綋鐒讹紝杩欐牱鍋氶渶瑕侀噸鏂板埛鏂版暣涓〉闈紝浣犺繖涓棶棰樻渶濂界殑瀹炵幇鏂规硶鏄敤AJAX锛岄偅鍙堝鏉傚緢澶氥傛垜骞虫椂涓嶇敤AS...
  • asp涓access鐨閾炬帴闂,甯屾湜楂樻墜瑙g瓟
    绛旓細鎻愮ずhttp500閿欒锛岀殑瑙e喅鍔炴硶锛岀湅鎴戠殑鎴浘锛屽嬀鎺夐偅涓夐」鍗冲彲銆傚彟澶栵細缁欎綘涓垜鐨勬垚鍨嬪畬鏁寸殑涓娈典唬鐮侊紝浣犲氨鐢ㄨ繖涓傚瓨鎴怌onn.asp锛屽摢閲岀敤鍝噷灏卞寘鍚繘鏉ワ細<!--#include file="Conn.asp"--> < Response.Charset="gb2312"Dim Conn Dim ConnSt Call MyConn()Sub MyConn()Set Conn = Server....
  • 姹俛sp+access楂樻墜
    绛旓細鍏堣鏄庝笅鍑犱釜鍙橀噺鐨勬剰涔夛細daysum_j 褰撳ぉ鐨勭簿鐓や骇閲 daysum_m 褰撳ぉ鐨勬湯鐓や骇閲 monthsum_j 褰撴湀鐨勭簿鐓や骇閲 monthsum_m 褰撴湀鐨勭簿鐓や骇閲 yearsum_j 褰撳勾鐨勭簿鐓や骇閲 yearsum_m 褰撳勾鐨勭簿鐓や骇閲 鎶婁笅闈㈢殑浠g爜鏀惧湪寰幆涔嬮棿锛歩f day(rs("鏃堕棿"))=day(now()) then if rs("鍝佺")="绮剧叅" then day...
  • asp+access浠g爜
    绛旓細< '杩炴帴鏁版嵁搴 set conn=server.createobject("adodb.connection")connstr="浣犺嚜宸辩殑鏁版嵁搴撲唬鐮"conn.open connstr set rs=server.createobject("adodb.recordset")rs.open "select falg from qyml",conn,1,1 if rs("falg")=3 then > <!--#include file="aboutus.asp"--> < else > <!-...
  • 姹傚姪楂樻墜涓涓寰堥毦鐨 asp+access 浠g爜
    绛旓細浣犳槸鍥炵瓟闂鐨勶紝杩樻槸鏉ヨ鍒嗙殑锛侀潬锛孊S涓涓嬶紒1銆佸绾х洰褰曪紝澶氬叧绯昏繛鎺ヨ〃锛屼篃鍙互鐢涓涓琛紝涓嶈繃鐩稿綋璐瑰姴浜嗭紒寤轰箟澶氳〃寤鸿繛鎺ワ紒2銆佸鏋滀綘绗竴涓兘瑙e喅浜嗭紝绗簩涓氨涓嶉毦瑙e喅锛屽畠浠熀鏈笂鏄竴涓被鍨嬬殑锛
  • 姹侫SP鏌ヨ鏁版嵁搴ACCESS浠g爜
    绛旓細椤甸潰ljhgzbiao.asp : 杈撳叆鍏抽敭璇嶏細 鏌ヨ缁撴灉椤甸潰ljhgzresult.asp :<!--#include file="conn.asp" --> < Dim skey skey=Request.Form("key")Dim rs,sql set rs=Server.CreateObject("ADODB.RecordSet")sql="SELECT * FROM [lbj] WHERE 闆朵欢缂栧彿="&skey&" or 闆朵欢鍚嶇О=鈥"&skey&"鈥 ...
  • ASP杩炴帴ACCESS
    绛旓細閫佷綘涓嚱鏁板惂锛屽彲浠ラ摼鎺c鍜宻ql鏁版嵁搴擄紝鎴戣嚜鍐欒嚜鐢ㄧ殑 rem === rem 鍑芥暟鍚嶏細ConnData rem 浣 鐢細閾炬帴鏁版嵁搴 rem 鍙 鏁帮細databasetype=閾炬帴绫诲瀷锛access鐢╝c锛屽叾浠栧氨鎸夌収sql閾炬帴 rem 鍙 鏁帮細db_name=鏁版嵁搴撳悕 rem 鍙 鏁帮細db_user=sql鐧诲綍璐﹀彿 rem 鍙 鏁帮細db_local=sql鏈嶅姟鍣ㄥ悕 rem...
  • 姹傜敤asp杩access鏁版嵁搴撶殑(鐢ㄦ埛鐧诲綍鍏ㄨ繃绋)鍦ㄧ嚎绛
    绛旓細Response.redirect("admin.htm")//鐧诲綍鎴愬姛椤甸潰璺宠浆 end if end if > //浠ヤ笅鏄袱涓緭鍏ユ枃浠舵鐨勪唬鐮侊紝鑷繁鍦ㄧ櫥褰曢〉闈腑娣诲姞
  • asp涓access鐨杩炴帴浠g爜
    绛旓細conn.open connstr '鎵撳紑鏁版嵁搴 set rs=server.CreateObject("adodb.recordset") '鏂板缓璁板綍闆嗗璞 sql="select * from 琛ㄥ悕" 'SQL璇彞,鍐冲畾浠庢暟鎹簱涓彇鍝簺鏁版嵁,濉叆rs璁板綍闆 rs.open sql,conn,1,1 '灏嗘暟鎹簱鍐呭濉叆rs璁板綍闆 '鏁版嵁搴撳唴瀹瑰~鍏ヨ褰曢泦鍚,灏卞彲浠ュ叧闂暟鎹簱杩炴帴浜,鏁版嵁搴撹繛鎺ュ叧闂...
  • 扩展阅读:永久免费不收费的网页 ... 永久观看不收费的直播 ... 不收费的免费网站 ... 免费的网页入口 ... 94色域tn屏幕 ... www.sony.com.cn ... 免费b站在线观看人数统计 ... hdmi色深模式444422 ... 十大免费cad网站入口软件 ...

    本站交流只代表网友个人观点,与本站立场无关
    欢迎反馈与建议,请联系电邮
    2024© 车视网