修改图书代码

<%@Language="VBScript" CodePage="936"%>
<html>
<head>
<title>修改图书</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<!--#include file="glsd_t.asp"-->
<%
'4.打开图书记录表,
'由查询语句 xgts.asp ? 图书号=2 控制,找出并显示2号记录。
'由输入语句 name="图书号" 控制,找出、显示并修改2号记录。
rs.open"select * from 图书记录表1 where 图书号="+Request("图书号"),cn,3,2

action=trim(Request("action"))
BookName=trim(Request("BookName"))
BookAuthor=trim(Request("BookAuthor"))
BookPublish=trim(Request("BookPublish"))
BookPrice=trim(Request("BookPrice"))
BookClass=trim(Request("BookClass"))
BookFace=trim(Request("BookFace"))
BookComment=trim(Request("BookComment"))

if action="update" then checkpass=true
if len(BookName)<1 then checkpass=false
if len(BookAuthor)<1 then checkpass=false
if len(BookPublish)<1 then checkpass=false
if len(BookPrice)<1 then checkpass=false
if len(BookClass)<1 then checkpass=false
if len(BookFace)<1 then checkpass=false
if len(BookComment)<1 then checkpass=false

if checkpass then
query="update 图书记录表1 set 图书名称='"
query=query+BookName+"',作者='"
query=query+BookAuthor+"',出版社='"
query=query+BookPublish+"',图书定价='"
query=query+BookPrice+"',图书类别='"
query=query+BookClass+"',图书封面='"
query=query+BookFace+"',内容简介='"
query=query+BookComment+"' where 图书号="+Request("图书号")
'修改请求的图书号所指定的记录

cn.Execute query
Response.Redirect"glsd.asp"
end if
%>
<form method="post" action="xgts.asp">
<input type="hidden" name="action" value="update">
<input name="图书号" type="hidden" id="图书号"

value="<%=Request("图书号")%>">
</p>
<p align="center"><span class="style1">修改图书</span></p>
<table width="55%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#00FFFF">
<td width="24%"><div align="right">图书名称:</div></td>
<td width="76%"><input name="BookName" type="text" id="BookName"

value="<%=Rs("图书名称")%>"></td>
</tr>
<tr bgcolor="#00FFFF">
<td width="24%"><div align="right">作者:</div></td>
<td width="76%"><input name="BookAuthor" type="text" id="BookAuthor"

value="<%=Rs("作者")%>"></td>
</tr>
<tr bgcolor="#00FFFF">
<td><div align="right">出版社:</div></td>
<td><input name="BookPublish" type="text" id="BookPublish"

value="<%=Rs("出版社")%>"></td>
</tr>
<tr bgcolor="#00FFFF">
<td><div align="right">图书定价:</div></td>
<td><input name="BookPrice" type="text" id="BookPrice"

value="<%=Rs("图书定价")%>">
必须输入数字</td>
</tr>
<tr bgcolor="#00FFFF">
<td><div align="right">图书类别:</div></td>
<td><input name="BookClass" type="text" id="BookClass"

value="<%=Rs("图书类别")%>"></td>
</tr>
<tr bgcolor="#00FFFF"><td><div align="right">图书封面:</div></td>
<td><input name="BookFace" type="text" id="BookFace"

value="<%=Rs("图书封面")%>">&nbsp; </td>
</tr>
<tr bgcolor="#00FFFF">
<td><div align="right">内容简介:</div></td>
<td><textarea name="BookComment" cols="44" rows="4" id="textarea5">
<%=Rs("内容简介")%></textarea></td>
</tr>
<tr bgcolor="#00FFFF">
<td><div align="right">操作:</div></td>
<td>
<div align="left">
<input type="Submit" name="Submit" value="提交">
<input name="Reset" type="reset" id="Reset" value="重置">
</div></td></tr>
</table>
</form>
</body>
</html>