%if not session("type")="3" then response.Redirect "../login.asp" else %> !--#include file="../conn.asp" --> LINK href="../css/home1.css" type=text/css rel=stylesheet> % set rs=server.CreateObject("ADODB.recordset") sql = "select * from [sushe] where m_su='" request.Form("su") "'" rs.open sql,conn,1,1 if rs.recordcount>0 then response.write("p align='center'>"request.QueryString("name")":" request.Form("su") "已经入库,请添加其他"request.QueryString("name")"!") response.Write "a href='xitong_set.asp' target='mainFrame'>继续添加/a>/p>" rs.close set rs=nothing conn.close set conn=nothing else rs.close conn.begintrans '开启事物功能 rs.open "sushe",conn,1,3 rs.addnew '插入数据到users表 rs("m_su")=request.Form("su") rs.update rs.close if err.number>0 then conn.begintrans '开启事物功能 ...中间是一些添加修改删除操作 如果出现错误就取消 conn.rollbacktrans '取消事物更改并结束事物 如果没问题,就保存 conn.CommitTrans '保存事物并结束事物 response.Write("p align='center'>添加失败,请重新添加""nbsp;""nbsp;") response.write "a href='xitong_set.asp' target='mainFrame'>重新添加/a>/p>" else conn.CommitTrans '保存事物并结束事物 response.write"SCRIPT language=JavaScript>alert('添加成功!');" response.write"setTimeout(parent.mainFrame.document.location='xitong_set.asp',0)" response.write"/SCRIPT>" end if end if %>