⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 updatenew.asp

📁 个人图书信息管理系统的程序代码
💻 ASP
字号:
<html>
	<head>
	<title>个人图书信息管理</title>
	</head>
	<body  alink="#000099" vlink="#00009" link="#00009">
	<h2 align="center">个人图书信息管理</h2>
<%
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open "Dbq=" & Server.Mappath("db/books.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}"
Dim turnnew,bname,id,conn,sql
turnnew=Request("turnnew")
If turnnew="" then 
id=Request.QueryString("id")
sql="select * from bookinfo where id=" & id
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn,1,1
%>
<table>
<form method="post" action="">
<input type="hidden" name="id" value="<%=rs("id")%>">
<tr><td>书名:<td><input type="text" name="bname" size="20" value="<%=rs("bookname")%>"><p>
<tr><td>图书类别<td><input type="text" name="btype" size="20" value="<%=rs("booktype")%>"><p>
<tr><td>作者:<td><input type="text" name="bauthor" size="20" value="<%=rs("author")%>"><p>
<tr><td>价格:<td><input type="text" name="bprice" size="20" value="<%=rs("price")%>"><p>
<tr><td>购买时间:<td><input type="text" name="btime" size="20" value="<%=rs("buytime")%>"><p>
<tr><td>图书内容介绍:<td><textarea name="bcontent" rows="5" cols="80" style="font-size: 16px; border: 3px solid #ffcfff;
   background-image: url('bookback.gif');background-attachment:fixed; background-position: center"><%=rs("content")%></textarea>
<tr><td>图书读后感:<td><textarea name="bopinion" rows="5" cols="80" style="font-size: 16px; border: 3px solid #ffcfff;
   background-image: url('bookback.gif');background-attachment:fixed; background-position: center"><%=rs("opinion")%></textarea>
<tr><td>存放位置:<td><input type="text" name="bplace" size="20" value="<%=rs("place")%>"><p>
<tr><td>是否推荐此书:<td>
<input type="radio" name="flag" value="1" <% if rs("flag")=1 then response.Write("checked") %> >是
<input type="radio" name="flag" value="0" <% if rs("flag")=0 then response.Write("checked") %>>否
<tr><td colspan="2"><input type="submit" name="turnnew" value="更新"> &nbsp;&nbsp;
</form>
</table>
<%
End If
if turnnew<>"" then
    id=Request.form("id")
	bname=Request.form("bname")
	btype=Request.form("btype")
	bauthor=Request.form("bauthor")
	bprice=Request.form("bprice")
	btime=Request.form("btime")
	bopinion=Request.form("bopinion")
	bplace=Request.form("bplace")
	sql="update bookinfo set bookname='" & bname & "',booktype='" &_
		btype & "',author='" & bauthor & "',price=" & bprice &_
		" ,buytime='" & btime & "',opinion='" & bopinion &_
		"',place='" & bplace & "'" & " where id=" & id
	 conn.Execute(sql)
	 Response.Write("修改成功")
End If 
%>		
<!--#include file="back.htm"-->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -