asp事务问题
<%On Error Resume Next Set conn=Server.CreateObject("ADODB.Connection")
conn.begintrans
conn.Open ("Driver={SQL Server};server=(local);uid=sa;database=student;pwd=")
sql="insert into class(id, class) values('8','四班')"
conn.Execute(sql)
sql1="insert into student(name,class)values('333333','666')"
conn.Execute(sql1)
If Err <>0 Then
conn.rollbacktrans
response.Write(err.description)
%>
<script language="javascript">
alert("数据添加失败!");
</script>
<%
Else
%>
<script language="javascript">
alert("数据添加成功!");
</script>
<%
conn.close
set conn=nothing
End If
%>
response.Write 输出的是没有活动事务
数据添加失败 对话框会弹出来的 可是事务没有回滚