473,757 Members | 8,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing table permissions in VB Code?

Hello,

Is there a way to change table permissions in VB Code? I can't seem to find
much that's concise in the help file. Here's the situation;

I have a table in the "data" portion of a split database. The table is a
list of values that shouldn't be accidentally changed by the user, so I've
taken the administer and delete permissions off. I'm using the regular
workgroup file, with the default Admin user name, so there is no funky
permissions set up. If a user knew how to use the permissions, and wanted
to, he/ she could put the administer permissions back on the table and
change what they wanted to.

What I'm trying to do is this; I need to add a field to the table, but in
order to do so, I need to add the Administer permissions back in, add the
filed, then remove the Administer permission. Can I do this in code? The
database is on the other side of the country, so I can't be on site to
update it.

Thanks!
Nov 13 '05 #1
2 4354
Jozef:

The Access security model is available through DAO. You could
programmaticall y iterate through all users and groups, and their appropriate
permissions on each database object. You could store the results to a table
or text file.

F. Scott Barker's "Microsoft Access 2000 Power Programming" has an excellent
chapter on how to programmaticall y access the security features of Access.
(There may be a newer edition of this book).

An example would be the following:

Dim db as Database
Dim con as Container
Dim doc as Document

Set db = CurrentDb
Set con = db.Containers(" Tables")
Set doc = con.Documents(" MyTable")

doc.UserName = "Admin"

Debug.Print doc.AllPermissi ons
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
"Jozef" <me@you.com> wrote in message
news:MkIYe.5415 69$s54.405494@p d7tw2no...
Hello,

Is there a way to change table permissions in VB Code? I can't seem to find
much that's concise in the help file. Here's the situation;

I have a table in the "data" portion of a split database. The table is a
list of values that shouldn't be accidentally changed by the user, so I've
taken the administer and delete permissions off. I'm using the regular
workgroup file, with the default Admin user name, so there is no funky
permissions set up. If a user knew how to use the permissions, and wanted
to, he/ she could put the administer permissions back on the table and
change what they wanted to.

What I'm trying to do is this; I need to add a field to the table, but in
order to do so, I need to add the Administer permissions back in, add the
filed, then remove the Administer permission. Can I do this in code? The
database is on the other side of the country, so I can't be on site to
update it.

Thanks!

Nov 13 '05 #2
Thanks David I'll bark up that tree.

You mentioned that you could tell what permissions are on the table, but can
you modify those permissions through code?

Thanks!

"David Lloyd" <Da***@NoSpamPl ease.com> wrote in message
news:rI******** *******@bignews 6.bellsouth.net ...
Jozef:

The Access security model is available through DAO. You could
programmaticall y iterate through all users and groups, and their
appropriate
permissions on each database object. You could store the results to a
table
or text file.

F. Scott Barker's "Microsoft Access 2000 Power Programming" has an
excellent
chapter on how to programmaticall y access the security features of Access.
(There may be a newer edition of this book).

An example would be the following:

Dim db as Database
Dim con as Container
Dim doc as Document

Set db = CurrentDb
Set con = db.Containers(" Tables")
Set doc = con.Documents(" MyTable")

doc.UserName = "Admin"

Debug.Print doc.AllPermissi ons
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or
warranties.
"Jozef" <me@you.com> wrote in message
news:MkIYe.5415 69$s54.405494@p d7tw2no...
Hello,

Is there a way to change table permissions in VB Code? I can't seem to
find
much that's concise in the help file. Here's the situation;

I have a table in the "data" portion of a split database. The table is a
list of values that shouldn't be accidentally changed by the user, so I've
taken the administer and delete permissions off. I'm using the regular
workgroup file, with the default Admin user name, so there is no funky
permissions set up. If a user knew how to use the permissions, and wanted
to, he/ she could put the administer permissions back on the table and
change what they wanted to.

What I'm trying to do is this; I need to add a field to the table, but in
order to do so, I need to add the Administer permissions back in, add the
filed, then remove the Administer permission. Can I do this in code? The
database is on the other side of the country, so I can't be on site to
update it.

Thanks!

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
9751
by: LRW | last post by:
Sorry to crosspost, but I have no idea if this is more a PHP question of general Linux question. I have a script that makes changes to image files, montages them into a jpg, and creates a Web page with that image. It starts with someone from our graphics dept. who I set up to copy the image files over to the Linux server with SAMBA. The files gain the owner/group of "nobody" and permissions of 744.
2
5610
by: Mark | last post by:
Hi, is there any way that I can automate granting user permissions to tables/ stored procedures in SQL server 2000? I have a whole bunch of tables and rather than having to right click each table/ then permissions in Enterprise manager I would like to be able to iterate through each table object in a database and grant the relevant permissions.... Same with stored procedures. Is this possible?? If so, how can I do it
0
1896
by: Rob | last post by:
I need to allow a user with the default "Full Data User" permissions on the front-end database to relink to a table in a backend to which he has the same permissions. (I'd like to do read, update, insert, delete, which are the DEFAULTS for a "Full data user", but just so you know I have also added "Administrator" for this group in front and backends, just to try and figure out the problem and it didn't help). Anyway I cycle through the...
1
7254
by: Brian Keanie | last post by:
What are the considerations/consequences of changing table names, form names and query names in an established database?
2
2971
by: Carlos | last post by:
Hi Forum, Is there a way to change the database access permissions for different IP addresses without having to re-start PostgreSQL? I often want to preclude all IP address but one from accessing the database. Currently, I change the pg_hba.conf file and re-start the database but I would like to be able to do the same thing without having to re-start.
0
1459
by: N. Quisitive | last post by:
Hello, I have a dilemma that has haunted me for a couple of months now. I am developing a content management system for a client who has their server managed by someone else (to be more specific, this system is being built for a school in a university; the servers are managed by the university and are highly secured). The problem is the administrators will not change the write permissions on the folder I would like to upload to. After...
2
3580
by: Richard Drysdall | last post by:
Hi. In C/C++, I'm used to using a table-driven approach for some problems to avoid large case statements. For example (off the top of my head, may contain syntax errors and error checking excluded): typedef struct { const char *name; unsigned int id;
2
1294
by: rjmlangley | last post by:
Hi Folks, I seem to have quite a conundrum here and I'm at my wits end. Essentially I have a HTML table where I'm trying to place a message at the top of the table should a value appear later in the table. My code is basically as follows... ... <table> <script language="javascript"> var myval = getmyval();
3
1683
by: MichaelHooker | last post by:
Newbie warning: please be gentle with me... I've never had to worry about permissions before, all my dbs have been single-user. I want to set up a PHP/MySQL based website to display photos listed in a table, which any visitor can interrogate (read-only) without a username or password; <link removed> is the sort of thing I'm aiming at, if you want an example. My webspace provider has all the right stuff, and I can do the coding myself, once...
0
9298
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10072
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9906
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.