📄 bookaddr.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<%option explicit
dim book,author,price,publish,num,photo,class1,memo
dim founderr,errmsg
founderr=false
book=request.form("book")
if book="" then
founderr=true
errmsg=errmsg &"★书名不能为空★"
end if
author=request.form("author")
if author="" then
founderr=true
errmsg=errmsg & "★作者不能为空★"
end if
price=request.form("price")
if price="" then
founderr=true
errmsg=errmsg & "★单价不能为空★"
end if
publish=request.form("publish")
if publish="" then
founderr=true
errmsg=errmsg & "★出版社不能为空★"
end if
num=request.form("num")
if num="" then
founderr=true
errmsg=errmsg & "★数量不能为空★"
end if
photo=request.form("photo")
if photo="" then
founderr=true
errmsg=errmsg & "★照片不能为空★"
end if
class1=request.form("class")
if class1="" then
founderr=true
errmsg=errmsg & "★类别不能为空★"
end if
memo=request.form("memo")
if memo="" then
founderr=true
errmsg=errmsg & "★备注不能为空★"
end if
if founderr then
response.write errmsg
%>
<html>
<head>
<style>
<!--
.font{color:navy;font-family:"宋体";font-size:12px;line-height:14px}
.3dfont{filter:glow(color=ffffff,strength=0) shadow(color=aaaaaa,direction=135);position:relative;
width:100%}
body {
background-color: #86BF78;
background-image: url();
}
-->
</style>
<meta name="generator" content="microsoft frongpage4.0">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>
<p class="font">
<font face="arial">(</font>带<font color="#ff0000"><strong><span
class="main2">*</span></strong></font><font
color="#000080">号为必填项<font face="aroal">)</font></font></samp>
<br>
<form method="post" action="">
<p><table width="398" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#CC0000">
<tr>
<td class="font" width="112" align="center">添加书籍资料信息</td>
</tr>
<tr>
<td class="font" width="112" align="left"> 书名<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="book" size="20" value="<%=book%>"></td>
</tr>
<tr>
<td class="font" width="112" align="left">作者<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="author" size="20" value="<%=author%>"></td>
</tr>
<tr>
<td class="font" width="112" align="left">单价<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="price" size="20" value="<%=price%>"></td>
</tr><tr>
<td class="font" width="112" align="left">出版社<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="publish" size="20" value="<%=publish%>"></td>
</tr>
<tr>
<td class="font" width="112" align="left">数量<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="num" size="20" value="<%=num%>"></td></tr>
<tr>
<tr>
<td class="font" width="112" align="left">照片<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="photo" size="20" value="<%=photo%>"></td>
</tr>
<td class="font" width="112" align="left">类别<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="class" size="20" value="<%=class1%>"></td>
</tr>
<tr>
<td class="font" width="112" align="left">备注<font color="#ff0000"><strong><span
class="main2">*</span></strong></font></td>
<td width="273" align="left"><input type="text" name="memo" size="20" value="<%=memo%>"></td>
</tr>
</table>
<p align="center"><input type="submit" value="提交" name="b1"><input type="reset" value="全部重写" name="b2"></p>
</form>
</body>
</html>
<%else dim connstr,conn,rs,sql
connstr="dbq="+server.MapPath("mdb/bookshop.mdb")+";driver= {microsoft access driver (*.mdb)};"
set conn=server.CreateObject("adodb.connection")
conn.open connstr
set rs=server.CreateObject("adodb.recordset")
sql="select* from book"
rs.open sql,conn,3,3
rs.addnew
rs("book")=book
rs("author")=author
rs("price")=csng(price)
rs("publish")=publish
rs("num")=cint(num)
rs("photo")=photo
rs("class")=class1
rs("memo")=memo
rs.update
rs.close
conn.close
set conn=nothing
set rs=nothing
%>
<script language="javascript">
alert("已经成功添加了一条记录,!谢谢!")
document.location="bookright.asp"
</script>
<%end if %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -