国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
ASP產(chǎn)品二級(jí)分類(lèi)代碼、帶數(shù)據(jù)庫(kù)的、可以后臺(tái)修改

數(shù)據(jù)庫(kù)(data.mdb)其包含兩個(gè)表BigSort(大類(lèi))和SmallSort(小類(lèi))
字段:
BigSort:BigSort_ID(自動(dòng)編號(hào))、BigSort_Name(文本)、Rank(數(shù)字)

SmallSort:SmallSort_ID(自動(dòng)編號(hào))、BigSort_ID(數(shù)字)、SmallSort_Name(文本)、Rank(數(shù)字)

自己添幾個(gè)記錄,注意兩個(gè)表中的BigSort_ID要一至啊。

實(shí)現(xiàn)代碼:

'************************************************************************************************************

conn.asp數(shù)據(jù)庫(kù)連接文件代碼:
<%
dim conn '數(shù)據(jù)庫(kù)連接
dim connstr '連接字符串
dim db '數(shù)據(jù)庫(kù)文件路徑

db = "data.mdb"
connstr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(db)
Set conn = Server.CreateObject("ADODB.Connection")
If Err Then
Err.Clear
Set Conn = Nothing
Response.Write "數(shù)據(jù)庫(kù)連接出錯(cuò),請(qǐng)打開(kāi)conn.asp文件檢查連接字串。"
Response.End
End If

conn.Open connstr
%>


'**********************************************************************************************************
List.asp代碼:
<!--#include file="Conn.asp" -->
<SCRIPT language="javascript">
<!--
function showmenu_item(sid)
{
which = eval("menu_item" + sid);
img = eval("sub_" + sid);
if (which.style.display == "none")
{
eval("menu_item" + sid + ".style.display=\"\";");
eval("sub_" + sid + ".src=\"Images/open.gif\";");
}else{
eval("menu_item" + sid + ".style.display=\"none\";");
eval("sub_" + sid + ".src=\"Images/close.gif\";");
}
}

//-->
</SCRIPT>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Table_Border">
<tr>
<td class="Table_Title_Bg">欄目導(dǎo)航</td>
</tr>
<%
Set Rs1=conn.Execute("Select*From BigSort Order By Rank")
Do While Not Rs1.Eof
Set Rs=conn.Execute("Select Count(*) As Total From SmallSort Where BigSort_ID="&Rs1("BigSort_ID")&"")
If Rs("Total")>0 Then
%>
<tr onClick="showmenu_item(<%=Rs1("BigSort_ID")%>)" style="cursor:hand;" onMouseOver="this.style.backgroundColor='#EFEFEF'" onMouseOut="this.style.backgroundColor=''" bgcolor="#FFFFFF">
<td style="text-indent:10px;" height="20px;"><img id="sub_<%=Rs1("BigSort_ID")%>" src="Images/close.gif" align="absmiddle"> <%=Rs1("BigSort_Name")&"("&Rs("Total")&")"%></td>
</tr>
<%Else%>
<tr style="cursor:hand;" onMouseOver="this.style.backgroundColor='#EFEFEF'" onMouseOut="this.style.backgroundColor=''" bgcolor="#FFFFFF">
<td style="text-indent:10px;" height="20px;"><img src="Images/close.gif" align="absmiddle"><%=Rs1("BigSort_Name")%></td>
</tr>
<%
End If
Set Rs=Nothing
%>
<tr id='menu_item<%=Rs1("BigSort_ID")%>' style="display:none">
<td style="text-indent:10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
Set Rs=conn.Execute("Select*From SmallSort Where BigSort_ID="&Rs1("BigSort_ID")&" Order By Rank")
Do While Not Rs.Eof
%>
<tr onMouseOver="this.style.backgroundColor='#EFEFEF'" onMouseOut="this.style.backgroundColor=''" bgcolor="#FFFFFF">
<td style="text-indent:20px;height:20px;cursor:hand;"><img src="Images/close.gif" align="absmiddle"> <%=Rs("SmallSort_Name")%></td>
</tr>
<%
Rs.Movenext
Loop
Set Rs=Nothing
%>
</table>
</td>
</tr>
<%
Rs1.Movenext
Loop
Set Rs1=Nothing
%>
</table>

'******************************************************************************************************************************
big.asp修改大類(lèi)的代碼:

<!--#include file="Conn.asp" -->
<%
Dim menu,BigSort_ID,BigSort_Name
menu=Request("menu")
BigSort_ID=Cint(Request("BigSort_ID"))
BigSort_Name=Trim(Request("BigSort_Name"))
If menu="" Then
%>
<form id="form" name="form" method="post" action="?menu=Saveadd">
<table width="100%" border="0" cellspacing="1">
<tr>
<td>類(lèi)別名稱(chēng):
<input name="BigSort_Name" type="text" id="BigSort_Name">
<input type="submit" name="Submit" value="添加"></td>
</tr>
</table>
</form>
<%
Set Rs=conn.Execute("Select*From BigSort Order By Rank")
Do While Not Rs.eof
%>
<form id="form<%=Rs("BigSort_ID")%>" name="form<%=Rs("BigSort_ID")%>" method="post" action="?menu=Saveedit&BigSort_ID=<%=Rs("BigSort_ID")%>" style="margin:0px;">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><input name="BigSort_Name" type="text" id="BigSort_Name2" value="<%=Rs("BigSort_Name")%>" />
<input type="submit" name="Submit" value="修改" />
<input type="button" name="Submit2" value="刪除"onClick="if(confirm('你確定刪除該欄目嗎?'))location.href='?menu=Delete&BigSort_ID=<%=Rs("BigSort_ID")%>'"></td>
</tr>
</table>
</form>
<%
Rs.movenext
loop
set Rs=nothing


ElseIf menu="Saveadd" Then
conn.Execute("insert into BigSort(BigSort_Name) values ('"&BigSort_Name&"')")
Response.Redirect "?"

ElseIf menu="Saveedit" Then
conn.execute("Update BigSort Set PBigSort_Name='"&BigSort_Name&"' Where BigSort_ID="&BigSort_ID&"")
Response.Redirect "?"

ElseIf menu="Delete" Then
conn.Execute("Delete From BigSort Where BigSort_ID="&BigSort_ID)
conn.Execute("Delete From SmallSort Where BigSort_ID="&BigSort_ID)
Response.Redirect "?"

End If
%>

'**********************************************************************************************************
small.asp修改小類(lèi)的代碼

<!--#include file="Conn.asp" -->
<%
Dim menu,BigSort_ID,SmallSort_ID,SmallSort_Name
menu=Request("menu")
BigSort_ID=Cint(Request("BigSort_ID"))
SmallSort_ID=Cint(Request("SmallSort_ID"))
SmallSort_Name=Trim(Request("SmallSort_Name"))
If menu="" Then
Set Rs1=conn.Execute("Select*From BigSort Order By Rank")
If Not Rs1.Eof Then
%><table width="100%" border="0" cellspacing="1">
<tr>
<td>大類(lèi)別:</td>
</tr>
<tr>
<td>
<%
Do While Not Rs1.eof
%>【<a href="?BigSort_ID=<%=Rs1("BigSort_ID")%>"><%=Rs1("BigSort_Name")%></a>】
<%
Rs1.movenext
Loop
%>
</td>
</tr>

</table>

<form id="form" name="form" method="post" action="?menu=Saveadd">
<table width="100%" border="0" cellspacing="1">
<tr>
<td>【
<%
If BigSort_ID=0 Then
Response.Write conn.Execute("Select Top 1 BigSort_Name From BigSort")(0)
BigSort_ID=conn.Execute("Select Top 1 BigSort_ID From BigSort")(0)
Else
Response.Write conn.Execute("Select BigSort_Name From BigSort Where BigSort_ID="&BigSort_ID)(0)
End If
%>
】子類(lèi)別名稱(chēng):
<input name="SmallSort_Name" type="text" id="SmallSort_Name">
<input name="BigSort_ID" type="hidden" value="<%=BigSort_ID%>">
<input type="submit" name="Submit" value="添加"></td>
</tr>
</table>
</form>
<%
Set Rs=conn.Execute("Select * From SmallSort Where BigSort_ID="&BigSort_ID)
Do While Not Rs.eof
%>
<form id="form<%=Rs("SmallSort_ID")%>" name="form<%=Rs("SmallSort_ID")%>" method="post" action="?menu=Saveedit&SmallSort_ID=<%=Rs("SmallSort_ID")%>&BigSort_ID=<%=BigSort_ID%>" style="margin:0px;">
<table width="100%" border="0" cellspacing="1">
<tr>
<td><input name="SmallSort_Name" type="text" id="Small_Name" value="<%=Rs("SmallSort_Name")%>" />
<input type="submit" name="Submit" value="修改" />
<input type="button" name="Submit2" value="刪除"onClick="if(confirm('你確定刪除該欄目嗎?'))location.href='?menu=Delete&SmallSort_ID=<%=Rs("SmallSort_ID")%>'"></td>
</tr>
</table>
</form>
<%
Rs.movenext
loop
set Rs=nothing
Else
Response.Write "暫無(wú)大類(lèi)"
End If
set Rs1=nothing


ElseIf menu="Saveadd" Then
conn.Execute("insert into SmallSort (BigSort_ID,SmallSort_Name) values("&BigSort_ID&",'"&SmallSort_Name&"')")
Response.Redirect "?"

ElseIf menu="Saveedit" Then
conn.execute("Update SmallSort Set SmallSort_Name='"&SmallSort_Name&"' Where SmallSort_ID="&SmallSort_ID)
Response.Redirect "?"

ElseIf menu="Delete" Then
conn.Execute("Delete From SmallSort Where SmallSort_ID="&SmallSort_ID)
Response.Redirect "?"

End If
%>

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
javascript:連接數(shù)據(jù)庫(kù)
得到剛插入的記錄的自動(dòng)編號(hào)值
最簡(jiǎn)單的ASP分頁(yè)代碼
使用PHP應(yīng)用查詢(xún)SAP HANA Express Edition里的數(shù)據(jù)
如何在ASP中連接MySQL數(shù)據(jù)庫(kù)
用ASP實(shí)現(xiàn)網(wǎng)上考試系統(tǒng)_天邊的一片云
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服