Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 26th, 2003, 06:22 AM
Registered User
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ajish_jose
Default Change the owner,permission of system table in MS


I would like to change the ownership, permissions of system tables like MSysRelationships etc. through code.

ANy help will be appriciated

Ajish T. Jose

Old September 28th, 2003, 12:16 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts

I'm curious why? Even a system administrator shouldn't have a reason to do that. Assuming it's possible, it would require code like the following. I'm logging on to Test.mdb with administrator priviledges, and running a procedure in Test.mdb that gives the 'NewUser' account permission to delete records from Table1.

Sub ModifyNewUserPermissions()
    Dim db As DAO.Database
    Dim wks As DAO.Workspace
    Dim doc As DAO.Document

    ' Reference the shared workgroup file.
    DBEngine.SystemDB = "C:\Temp\TestSystem.mdw"

    Set wks = DBEngine.CreateWorkspace("", "Bob Bedell", "password")
    Set db = wks.OpenDatabase("C:\Temp\Test.mdb")

    Set doc = db.Containers("Tables").Documents("Table1")
    doc.UserName = "NewUser"
    doc.Permissions = dbSecDeleteData

End Sub

See the Permissions enum for other 'dbSec' settings. The only table permission options available through code, however, are to read, edit, and delete table definitions, or read, edit and delete records from tables. Even users with read-only priviledges already have read access to the MSysObjects table which you might want to query from time to time (to get lists of objects in the database), but there is nothing in any of the other system tables that users (or administrators for that matter) should get anywhere near.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the format of MS Excel Cells from MS Access hewstone999 Access VBA 0 March 7th, 2008 07:19 AM
How to change File Owner using .NET 1.1 bhuvanagiri .NET Framework 1.x 0 January 24th, 2008 05:09 AM
how to change owner instead of DBO beetle_jaipur SQL Server 2000 1 April 6th, 2006 08:44 AM
System Windows Permission lpastor C# 0 July 9th, 2004 02:26 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.