how do I give permission to user to Create a temp table in VBA

L

Lois

I am in xp and have a front-end application and back-end tables both in
Access. I want a user group to be able to create a temporary table to which
he can have full rights to read and write and delete. This temporary table
holds the parameters for the report and is necessary in the context of
multi-user.

I found a procedure in the technical aricles to set permissions
(http://msdn.microsoft.com/library/d...n-us/odc_2003_ta/html/odc_landaccess02_ta.asp and scroll down to last item of the report) .
I can't seem to get the permissions I need. On the open event of the
report form, I call a function to set group permissions so that the user now
has full rights:

Public Function SetGroupPermissions(ByVal strGroup As String) As Boolean
On Error GoTo SetGroupPermissions_Err

Dim catDB As ADOX.Catalog

Set catDB = New ADOX.Catalog
With catDB
.ActiveConnection = CurrentProject.Connection
.Groups(strGroup).SetPermissions Null, adPermObjTable, dAccessGrant,
adRightUpdate
End With
Set catDB = Nothing
SetGroupPermissions = True
Exit Function

SetGroupPermissions_Err:
MsgBox Err.Number & ":" & Err.Description
SetGroupPermissions = False
End Function

and then on the Close event of the form I call the revoke the permissions.

Public Function RevokeGroupPermissions(ByVal strGroup As String) As Boolean
On Error GoTo RevokeGroupPermissions_Err

Dim catDB As ADOX.Catalog

Set catDB = New ADOX.Catalog
With catDB
.ActiveConnection = CurrentProject.Connection
.Groups(strGroup).SetPermissions Null, adPermObjTable,
adAccessRevoke, adRightFull
End With
Set catDB = Nothing

RevokeGroupPermissions = True
Exit Function

RevokeGroupPermissions_Err:
MsgBox Err.Number & ":" & Err.Description
RevokeGroupPermissions = False
End Function
--
But this doesn't work and I still get the message that the user does not
have permission the use the tmpTable that is created. Or could it be that
the table is created but I have to assign rights. How do I do this?

Thanks

Lois
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top