ms access - How can I set user-level security from VBA on a different opened database? -


I have access to Microsoft MDE database that connects two backends simultaneously. I also give the user the option to link to the sandbox mode backend located on my local computer. When I'm developing the foreground, I'm connected to my local version of the sandbox so that I can not mess with two backindes. Occasionally, I want to reset my sandbox to match the data in backends. Sandbox is slightly different in which I connect two backends together. (One of the backend logs data, so I delete that data in my new sandbox.) I have the process of copying files and data through VBA.

I also want to automate setting permissions after copying to the new sandbox file should have a lot of humble permission in the sandbox file because its data does not really make any difference. I'm getting the "not set object" error. My developer frontend in VBA in a sandbox file Tables after trying to get the collection I have guessed that I frontend developer file container s and related I can see the document s, but I can not see them from the frontend developer file. I try to use them programmatically.

I assume that this access should have some built-in security features. Perhaps Microsoft does not want to allow any file to modify the security of a different file. Here's some code that helps you see what I'm doing.

The use of the same user-level security for all in the database is located on .amdivi file server database was basically access built in 2000, but upgraded since then me access in 2010 has given. However, I maintain the original Access 2000 file format that is capable of using built-in multi-user protection.

  public function CorrectSandbox () Dim appBackend application dim appLog application dim appSandbox application dim TDF TableDef dim as I long dim dock DAO.Document 'files as low CTR DAO.Container MFile.DeleteFile LOCAL_SANDBOX_PATH mFile Copy as as as of the as. CopyFile PRODUCTION_PATH, LOCAL_SANDBOX_PATH 'Copy log tables AppSandbox = OpenSandbox (Set AppLog = OpenLog (Set appLog.CurrentDb (for each TDF))). If TableDefs left $ (tdf.Name, 1) = "_" then the app sandbox. DoCmd .TransferDatabase acImport, "Microsoft Access", GetAdminPath (Elive), acTable, tdf.Name, tdf.Name, set it true 'permissions for the object accordingly set CTR = appSandbox.CurrentDb (). Containers! Tabl es set Dock = ctr.Documents (tdf.Name) '*** ERROR: doc.UserName = "user" doc.Permissions = 852,222 then end sets do not mind, next TDF appLog.Quit appSandbox.Quit End Function  


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -