How can I check if Back End is read-only?

S

stasamation

I have a FE/BE database. The BE resides on the network. Some of the
users have read-write permissions to the BE and some have read-only
permissions. (Permissions are set via standard Windows security).

I am looking for a way to check if the BE is read-only -- what I want
to do is enable or disable certain GUI buttons accordingly. In other
words, for those users who have read-only permissions to the BE, I
want to disable such buttons as "Edit" and "Delete". My plan is to
put this code in the "On Load" event of various FE forms.

How can I check if the linked BE is read-only? Also, should I be
checking if the file permissions are read-only or is it better to
check if the recordset is updatable?

Any help would be greatly appreciated.

Thanks,
Stas
 
J

James A. Fortune

stasamation said:
I am still hoping somebody could offer some advice on this...

Thanks

<handwave> I really hope WinFS will be able to do that effectively. In
addition to the ReadOnly flag on an mdb file, there may or may not be an
ldb file. If there is an ldb file, there may or may not be a user with
exclusive access to the mdb file. The user may or may not have
permissions in the directory where the backend mdb resides (this seems
to be what you're asking about). Right now there seems to be no easy
way to check exclusive usage short of raising and handling an error. My
guess is that the ReadOnly flag can be examined in code. The existence
of an ldb file can certainly be checked in code using the Dir()
function. My best guess is that the user's permissions for the backend
directory can also be checked in code. I think that the exclusive usage
cannot be checked without raising an error. I hope I'm wrong. If so,
Microsoft may or may not decide that the problem is worth addressing.
It would be interesting to go through all that and then find out that
the user still can't edit a table because of Access' security
permissions for that user :). Maybe someone will provide a pointer to
a newsgroup article or to the appropriate API functions for some of
those tasks. BTW, Access' security permissions should be attainable
without using API functions. Did you try Googling Access newsgroups?
</handwave>

The following link may aid your search for appropriate API functions:

http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/3163bc987793684c

Post back if you find any of the answers before I do.

James A. Fortune
(e-mail address removed)

When I was working with TeX and LaTeX before HTML and XML existed, I had
no idea how useful getting used to markup would prove to be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top