S
Steve Marsden
I have a secured database which comprises several tables. Generally I want
users who log on to only have read access to the tables and this how their
permissions are set.
However, there is one place in my system where some VB code runs and it
needs to update the tables they only have read permissions to.
How can I change the permission temporarily with VB code so that the VB code
can update the table and then set the permission back to read only?
I have tried the following similar to that listed in the security FAQ but
this fails for the users presumably because they don't have permission to
change permissions!
Set db = CurrentDb()
Set con = db.Containers("Tables")
Set doc = con.Documents("Customers")
doc.UserName = "Users"
doc.Permissions = doc.Permissions Or dbSecInsertData
' code here to update customers table
doc.Permissions = doc.Permissions And Not dbSecInsertData
users who log on to only have read access to the tables and this how their
permissions are set.
However, there is one place in my system where some VB code runs and it
needs to update the tables they only have read permissions to.
How can I change the permission temporarily with VB code so that the VB code
can update the table and then set the permission back to read only?
I have tried the following similar to that listed in the security FAQ but
this fails for the users presumably because they don't have permission to
change permissions!
Set db = CurrentDb()
Set con = db.Containers("Tables")
Set doc = con.Documents("Customers")
doc.UserName = "Users"
doc.Permissions = doc.Permissions Or dbSecInsertData
' code here to update customers table
doc.Permissions = doc.Permissions And Not dbSecInsertData