bookdelt.asp
来自「ASP+SQL Server的图书馆管理系统」· ASP 代码 · 共 36 行
ASP
36 行
<!--#include File="conndb.asp"-->
<html>
<head>
<title>删除商品信息</title>
</head>
<body>
<%
Dim ids
ids = Request.QueryString("book_id")
sql = "Select * From Book_Info Where book_id In ("&ids&")"
Set Rs = Conn.Execute(sql)
Do While Not Rs.Eof
'删除图片
filename = Server.MapPath("book_imageFile")
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
If (MyFileObject.FileExists(trim(filename))) Then
MyFileObject.DeleteFile trim(filename)
End If
Rs.MoveNext()
Loop
'删除商品记录
sql = "Delete From book_info Where book_id In ("&ids&")"
Conn.Execute(sql)
Set Rs = Nothing
Conn.Close()
%>
</body>
<script language="JavaScript">
alert("成功删除!");
location.href = "BookList.asp?flag=0";
</script>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?