HandsOn Revoking Security Permissions

This hands-on requires prior completion of Hands-On procedures 22-5 and 22-9.

1. Switch to the Visual Basic Editor window and insert a new module.

2. In the module's Code window, enter the RevokePermission procedure as shown below.

Sub RevokePermission()

Dim conn As ADODB.Connection

On Error GoTo ErrorHandler

Set conn = CurrentProject.Connection conn.Execute "REVOKE DELETE ON CONTAINER TABLES FROM Mozart" ExitHere:

If Not conn Is Nothing Then

If conn.State = adStateOpen Then conn.Close End If

Set conn = Nothing Exit Sub ErrorHandler:

MsgBox Err.Number & ":" & Err.Description Resume ExitHere End Sub

Part III

Figure 22-3: After running the procedure in Hands-On 22-10, the Delete Data permission on new tables and queries for the members of the Mozart group is turned off.

0 0

Post a comment