?? sp25175_book_save.asp
字號(hào):
<!--#include file="conn.asp"-->
<%
bookname=trim(request("bookname"))
booktypeid=trim(request("booktypeid"))
bookbianhao=trim(request("bookbianhao"))
publishing=trim(request("publishing"))
writer=trim(request("writer"))
bookmoney=trim(request("bookmoney"))
booknumber=trim(request("booknumber"))
bookdate=trim(request("bookdate"))
onno=trim(request("onno"))
booktxt=trim(request("booktxt"))
id=trim(request("id"))
set rs=server.createobject("adodb.recordset")
if id="" then sql="select * from book where bookname='"&bookname&"' or bookbianhao='"&bookbianhao&"'"
if id<>"" then sql="select * from book where id="&id
rs.open sql,db,1,3
if not rs.eof or not rs.bof then
if id="" then response.write "<script language=javascript>alert('對(duì)不起已經(jīng)有這本圖書');history.back(-1)</script>"
if id<>"" then
rs("bookname")=bookname
rs("booktypeid")=booktypeid
rs("bookbianhao")=bookbianhao
rs("publishing")=publishing
rs("writer")=writer
rs("bookmoney")=bookmoney
rs("booknumber")=booknumber
rs("bookdate")=bookdate
rs("onno")=onno
rs("booktxt")=booktxt
rs.update
rs.close
set rs=nothing
response.redirect "sp25175_detail_modify.asp?id="&id&"&mage2fly=修改成功"
end if
else
rs.addnew
rs("bookname")=bookname
rs("booktypeid")=booktypeid
rs("bookbianhao")=bookbianhao
rs("publishing")=publishing
rs("writer")=writer
rs("bookmoney")=bookmoney
rs("booknumber")=booknumber
rs("bookdate")=bookdate
rs("onno")=0
rs("booktxt")=booktxt
rs.update
id=rs("id")
rs.close
set rs=nothing
response.redirect "sp25175_detail_modify.asp?id="&id&"&mage2fly=添加成功"
end if
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -