Article ID: 210154 - Last Review: October 11, 2006 - Revision: 3.2 HOW TO: Change the Owner of a New Table in Access 2000This article was previously published under Q210154 On This PageSUMMARY
This article describes a method that you can use to transfer the ownership
of a newly created table to a specific owner. For example, if the
functionality within a secured database enables the current user to import
a table, that user will be the owner of the table and will have full
permissions on that table. Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. If your secured database application enables users to import a table, those users will be the owners of the table and will have full permissions on that table. The function in this article demonstrates how you can programmatically create a secured session as a user different from the current user and transfer ownership of an imported object from the current user to another user. Call the following function within a macro, a function, or a Sub procedure that imports the table that you want to secure. Call the function immediately after importing the table to ensure that permissions have been set. Method 1: Using a Macro
Action: RunCode
Function Name: ChangeOwner("MyTable","MyNewOwner", "MyNewOwnerPass")
Method 2: Using Visual Basic for ApplicationsREFERENCESFor more information about database security and object ownership, click Microsoft Access Help on the
Help menu, type secure a microsoft access database in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned. For more information about running a Function procedure from a macro, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type runcode action in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
| Article Translations
|
Back to the top
