By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,117 Members | 2,093 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,117 IT Pros & Developers. It's quick & easy.

How do you lock table (or view) fields from editing???

P: n/a
Hello:

I have an Access 2K form I built from a SQL Server 7.0 view. I want to
lock certain fields in the database from users so they can see them on
the views and forms, but NOT be able to edit them.

I've looked in BOL, MS SQL Server web page and SQL Server 7.0 books and
could not find how to do this.

Any advise will be greatly appreciated.

Thanks,
Richard

Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
with sql server it is easy. One possible way:
- start enterprise manager
- open your database
- go into tables/views
- right click on a table/view
- select all tasks -> manage grants
(i don't know if this is the name, i have only
the german version)
in this window you can select your view/table
in the combobox, you see all users with their
rights and on the bottom you find the button
'columns' where you can set the rights for
a specific user on a specific row.

hth,
Helmut


"Richard Holliingsworth" <wi*********************@boeing.com> schrieb im
Newsbeitrag news:HJ********@news.boeing.com...
Hello:

I have an Access 2K form I built from a SQL Server 7.0 view. I want to
lock certain fields in the database from users so they can see them on
the views and forms, but NOT be able to edit them.

I've looked in BOL, MS SQL Server web page and SQL Server 7.0 books and
could not find how to do this.

Any advise will be greatly appreciated.

Thanks,
Richard

Jul 20 '05 #2

P: n/a
Richard Holliingsworth <wi*********************@boeing.com> wrote in message news:<HJ********@news.boeing.com>...
Hello:

I have an Access 2K form I built from a SQL Server 7.0 view. I want to
lock certain fields in the database from users so they can see them on
the views and forms, but NOT be able to edit them.

I've looked in BOL, MS SQL Server web page and SQL Server 7.0 books and
could not find how to do this.

Any advise will be greatly appreciated.

Thanks,
Richard


From the MSSQL side, you need to ensure that your users can SELECT
from the tables, but not UPDATE/INSERT/DELETE. Have a look at GRANT
and REVOKE in Books Online for more information. You should probably
also have a look at the information on database roles as well - you
can add users to the role, then grant the permissions to the role,
which makes things easier to manage.

Simon
Jul 20 '05 #3

P: n/a
Helmut you are close. I went to the table/view and right clicked and
got a menu. From the "All Tasks" selection, I got another menu that
included "Manage permissions" not "Manage Grants"
I selected that option and got the user permissions for the table but
NOT for the columns

So, I still cannot lock fields (columns) on a table/view.

The first responder misunderstood my question. I am not trying to lock
the users from the table/view. They MUST be able to edit certain fields
bot NOT all of them. So I must be able to lock fields from update, NOT
the whole table.

Thanks for any other guidance.

Richard

Helmut Wöss wrote:
with sql server it is easy. One possible way:
- start enterprise manager
- open your database
- go into tables/views
- right click on a table/view
- select all tasks -> manage grants
(i don't know if this is the name, i have only
the german version)
in this window you can select your view/table
in the combobox, you see all users with their
rights and on the bottom you find the button
'columns' where you can set the rights for
a specific user on a specific row.

hth,
Helmut


"Richard Holliingsworth" <wi*********************@boeing.com> schrieb im
Newsbeitrag news:HJ********@news.boeing.com...

Hello:

I have an Access 2K form I built from a SQL Server 7.0 view. I want to
lock certain fields in the database from users so they can see them on
the views and forms, but NOT be able to edit them.

I've looked in BOL, MS SQL Server web page and SQL Server 7.0 books and
could not find how to do this.

Any advise will be greatly appreciated.

Thanks,
Richard



Jul 20 '05 #4

P: n/a

"Richard Holliingsworth" <wi*********************@boeing.com> wrote in
message news:HJ********@news.boeing.com...
Helmut you are close. I went to the table/view and right clicked and got a
menu. From the "All Tasks" selection, I got another menu that included
"Manage permissions" not "Manage Grants"
I selected that option and got the user permissions for the table but NOT
for the columns

So, I still cannot lock fields (columns) on a table/view.

The first responder misunderstood my question. I am not trying to lock the
users from the table/view. They MUST be able to edit certain fields bot NOT
all of them. So I must be able to lock fields from update, NOT the whole
table.

Thanks for any other guidance.

Richard

I may have misled you by not mentioning that GRANT/REVOKE can be applied to
columns as well as to entire tables (although only SELECT/UPDATE apply at a
column level, of course). The Enterprise Manager functionality that Helmut
described is simply a graphical interface to GRANT/REVOKE. I don't have
SQL7, but the SQL2000 permissions screen has a button at bottom left called
'Columns', which allows you to manage column level permissions.

In Query Analyzer you would do something like this:

grant select on dbo.MyTable (col1, col2, col3) to MyRole
grant select, update on dbo.MyTable (col4, col5) to MyRole

Simon


Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.