以下是引用zhengjialon在2003-1-8 17:11:34的发言:
不支持。
Public Function DelUser(UserID As Long) As Boolean
On Error GoTo Err_Handle
Dim cn As ADODB.Connection
Dim strSQL As String
Set cn = CurrentProject.Connection
cn.BeginTrans '开始事务管理
If UserID = 0 Then
strSQL = "DELETE * FROM usysUser" '全部删除!
Else
strSQL = "DELETE * FROM usysUser WHERE UserID=" & UserID
End If
'MsgBox strSQL
cn.Execute strSQL
'可以连续执行多条不同语句,测试的时候可以故意设置一个错误的值!验证sql支持事物!
cn.CommitTrans '递交事物!!表间关系建立后,自动删除相关的表!比如 权限表!
DelUser = True
Exit_here:
Exit Function
Err_Handle:
If Err.Number <> 0 Then
MsgBox Err.Number & vbCrLf & Err.Description
cn.RollbackTrans '回滚!
DelUser = False
End If
End Function
[此贴子已经被作者于2003-1-9 12:47:44编辑过]
|