📄 quesdelete.asp
字号:
<%@ language="vbscript" %>
<!--#include file="adovbs.inc"-->
<%
CurrBookID=request("bookbm")
CurrPage=Cint(request("CurrPage"))
Findstr=request("Find")
DbPath = SERVER.MapPath("..\bookshop.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath
sql="Delete * from book Where bookbm='"&CurrBookID&"' "
conn.Execute(sql)
set rs=server.createobject("adodb.recordset")
sql="select * from book where bookname like '%"&Findstr&"%' order by bookbm"
rs.open sql,conn,adopenkeyset,adlockoptimistic,adcmdtext
if rs.RecordCount<=0 then
response.write "数据库没有相应记录"
response.end
else
i=0
rs.PageSize=10
end if
PageCount=clng(rs.PageCount)
if CurrPage<=0 then
CurrPage=1
end if
if CurrPage>=PageCount then
CurrPage=PageCount
end if
BookNum=rs.RecordCount
rs.absolutePage = CurrPage
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" link="#005f02" vlink="#00b06f" background="../FOTO/039.gif">
<p align="center">
<h2 align="center">搜索结果</h2>
<table border="0" align="center" width="80%" >
<tr>
<td colspan="5" align="left" height="25"><font size="2" color="#006600">选择当前页:</font></td>
<td colspan="5" align="left" height="25"><font size="2" color="#006600">总页数:</font><font size="3"><% =PageCount %></font></td>
<td colspan="5" align="left" height="25"><font size="2" color="#006600">当前页:</font><font size="3"><% =CurrPage %></font></td>
<td colspan="5" align="left" height="25"><font size="2" color="#006600">每页记录数:</font><font size="3"><% =rs.PageSize %></font></td>
</tr>
<% LinePage=18
for i=0 to PageCount\LinePage-1 %>
<tr> <% for j=1 to LinePage %>
<td><font size="2" color="#006600"><a href=UpDown.asp?Class=<% =CurrClass %>&Field=<% =FindField %>&Find=<% =FindStr %>&CurrPage=<% =i*LinePage+j %>>[<% =i*LinePage+j %>]</a></font></td>
<% next %>
</tr>
<% next %> <% EndPage=PageCount mod LinePage %>
<tr>
<% for j=1 to EndPage %>
<td><font size="2" color="#006600"><a href=Updown.asp?Class=<% =CurrClass %>&Field=<% =FindField %>&Find=<% =FindStr %>&CurrPage=<% =i*LinePage+j %>>[<% =i*LinePage+j %>]</a></font></td>
<% next %>
</tr>
</table>
<hr width="80%">
<table border="1" align="center" width="80%" vspace="15" cellspacing="0" bordercolor="#666600">
<tr border=1 valign="top" bgcolor="#6666ff">
<td width="40%" align="center"><font color="#ffffff">书名</font></td>
<td width="30%" align="center"><font color="#ffffff">作者</font></td>
<td width="10%" align="center"><font color="#ffffff"></font></td>
<td width="10%" align="center"><font color="#ffffff"></font></td>
<td width="10%" align="center"><font color="#ffffff"></font></td>
</tr>
<% do until rs.eof %>
<tr border="1" valign="top">
<td bgcolor="#CCCCFF" width="40%" align="left" height="25"><%=rs("bookname")%></td>
<td bgcolor="#CCCCFF" width="30%" align="center" height="25"><%=rs("Author")%></td>
<td bgcolor="#CCCCFF" width="10%" align="center" height="25"><a href="xq.asp?bookbm=<%=rs("bookbm")%>" target="_TOP">详情</a></td>
<td bgcolor="#CCCCFF" width="10%" align="center" height="25"><a href="Delete.asp?bookbm=<%=rs("bookbm")%>&Class=<% =CurrClass %>&Field=<% =FindField %>&Find=<% =FindStr %>&CurrPage=<% =CurrPage %>" target="main">删除</a></td>
<td bgcolor="#CCCCFF" width="10%" align="center" height="25"><a href="Edit.asp?bookbm=<%=rs("bookbm")%>" target="main">修改</a></td>
</tr>
<%
i=i+1
if i>=rs.PageSize then exit do
rs.movenext
loop
rs.close
set rs=nothing
set conn=nothing
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -