我想写一个事件过程,
但不知如何写,
请各位指导一下!作者: 没牙兔兔 时间: 2003-11-6 23:13
使用事务处理
On Error GoTo Cmd还原_err
Dim Conn As ADODB.Connection
Dim Rs As ADODB.Recordset
Set Conn = CurrentProject.Connection
Set Rs = New ADODB.Recordset
'事务处理
Conn.BeginTrans
Rs.Open "select * from tbl积分 ", Conn, adOpenDynamic, adLockOptimistic
Rs.AddNew
Rs!Name = "甲"
Rs!送 = 1000
Rs.update
Rs.AddNew
Rs!Name = "乙"
Rs!收 = 1000
Rs.update
Conn.CommitTrans
Boolintrans = False
Rs.Close
Set Rs = Nothing
Exit_Cmd还原:
Exit Sub
Cmd还原_err:
If Boolintrans Then
Conn.RollbackTrans
End If
MsgBox Err.Description
Resume Exit_Cmd还原
End Sub作者: yodong 时间: 2003-11-7 17:33
请问没牙兔兔,事务处理用在那里的呀,如何调用呀,是不是用在SQL2000里的。谢谢!!作者: beibeijia 时间: 2003-11-7 22:12
谢谢兔兔,测试通过!