看了楼主的数据库,把程序补上
<html>
<head>
<title>
使用事务处理方法
</title>
</head>
<%
t1=request.form("t1")
t2=request.form("t2")
t3=request.form("t3")
t4=request.form("t4")
r1=request.form("r1")
r1=cstr(r1)
if r1="是" then
r1="1"
else
r1="0"
end if
set conn=server.createobject("adodb.connection")
conn.open "Driver=Driver do Microsoft Access (*.mdb);Uid=admin;pwd=;DBQ="&server.MapPath("注册信息.mdb")
conn.begintrans
str="insert into client(t1,t2,r1,t3,t4)"
str=str&"values('"+t1+"','"+t2+"',"+r1+",'"+t3+"','"+t4+"')"
conn.execute str
if (t1="" or t2="" or t3="" or t4="") then
conn.rollbacktrans '回滚
conn.close
set conn=nothing
response.write "交易失败,回滚至修改前的状态!"
response.end
else
conn.committrans '提交事务
conn.close
set conn=nothing
response.write "交易成功!"
response.end
end if
conn.close
set conn=nothing
%>
</body>
</html>