A
Aragorn2004
Hallo, i would read the permissions for a particular user for database itself
in Access 2002.
How suggested by MSDN Site resources I set the Name argument to Null and
set the ObjectType argument to adPermObjDatabase.
But i receive an error "object invalid or unknown to provider".
The code is
Dim catDb As ADOX.Catalog
Dim usrPerms As ADOX.User
Dim grpPerms As ADOX.Group
Dim lngPerms As Long
Dim objTable As Access.AccessObject
Set catDb = New ADOX.Catalog
With catDb
.ActiveConnection = CurrentProject.Connection
For Each usrPerms In .Users
lngPerms = .Users(usrPerms.Name).GetPermissions(Null,
adPermObjDatabase)
For Each objTable In CurrentData.AllTables
If Left(objTable.Name, 4) <> "MSys" Then
lngPerms =
..Users(usrPerms.Name).GetPermissions(objTable.Name, adPermObjTable)
End If
Next objTable
next
end with
What's wrong ?
Thanks in advance ?
Aragorn
in Access 2002.
How suggested by MSDN Site resources I set the Name argument to Null and
set the ObjectType argument to adPermObjDatabase.
But i receive an error "object invalid or unknown to provider".
The code is
Dim catDb As ADOX.Catalog
Dim usrPerms As ADOX.User
Dim grpPerms As ADOX.Group
Dim lngPerms As Long
Dim objTable As Access.AccessObject
Set catDb = New ADOX.Catalog
With catDb
.ActiveConnection = CurrentProject.Connection
For Each usrPerms In .Users
lngPerms = .Users(usrPerms.Name).GetPermissions(Null,
adPermObjDatabase)
For Each objTable In CurrentData.AllTables
If Left(objTable.Name, 4) <> "MSys" Then
lngPerms =
..Users(usrPerms.Name).GetPermissions(objTable.Name, adPermObjTable)
End If
Next objTable
next
end with
What's wrong ?
Thanks in advance ?
Aragorn