473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 4322
Jozef:

The Access security model is available through DAO. You could
programmatically 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 programmatically 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.AllPermissions
--
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.541569$s54.405494@pd7tw2no...
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***@NoSpamPlease.com> wrote in message
news:rI***************@bignews6.bellsouth.net...
Jozef:

The Access security model is available through DAO. You could
programmatically 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 programmatically 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.AllPermissions
--
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.541569$s54.405494@pd7tw2no...
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
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...
2
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...
0
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,...
1
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
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...
0
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...
2
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...
2
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...
3
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.