[mso] Re: Make Access DB Read Only :VSMail mx1

  • From: "James LaBorde" <jlaborde@xxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Wed, 13 Dec 2006 14:58:41 -0800

Ray,

Since you are using XP Home you are rather limited.  However, since you =
do have restrictions based on which user is signed on to the computer, =
you have a chance.  Here is what I would do.  First, create two sets of =
forms.  The first set has full priveleges, the second is basically read =
only (you can set this in form properties - Allow Edits, Allow =
Deletions, Allow Editions).  Next, Create your own switchboard that =
accesses each of these forms.  There is code available that can access =
the Windows API to determine the user name signed on to the computer.  =
Write a brief piece of code to create a function to open the switchboard =
for the appropriate user.  Something like:

Function OpenSwitch()

Dim strUser as string

struser =3D fOSUserName()

If struser =3D "Administrator" then
        DoCmd.OpenForm "frmAdminSwitch", acNormal, "", "", , acNormal
Else
        DoCmd.OpenForm "frmNonAdminSwitch", acNormal, "", "", , acNormal
End If

Here is the code for Getting the user name.  This is not mine, I got it =
off of the internet but do not recall the location (I believe it was =
mvps.org/access):

***Snip Code here***
Option Compare Database

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
    "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
    strUserName =3D String$(254, 0)
    lngLen =3D 255
    lngX =3D apiGetUserName(strUserName, lngLen)
    If lngX <> 0 Then
        fOSUserName =3D Left$(strUserName, lngLen - 1)
    Else
        fOSUserName =3D ""
    End If
End Function
***Snip Code Here***


Then create an autoexec macro that calls the OpenSwitch() function.  =
Make this an MDE and you should effectively restrict the ability of the =
user to manipulate the data.


I hope this puts you on the right path

James

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx]On
Behalf Of Ray Shapp
Sent: Wednesday, December 13, 2006 2:15 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Make Access DB Read Only :VSMail mx1


Hi David,

<<Need to check the permissions on the directory and the file.  I =
suspect that=20
they are too lax.>>

The operating system is WinXP Home. I thought it wasn't possible to set=20
permissions on a directory (folder) within WinXP Home. Can you tell me =
how to=20
set permissions on a file or a folder in a way that could not be undone =
by any=20
user?

Also, remember that the PC is not networked and is not connected to the=20
internet. It is a stand-alone PC in a public place where anyone can =
reboot.=20
The only security measure is that the one account which has =
administrator=20
privileges is password-protected. The public account has no =
administrator=20
privilege and no password. The machine is intended to be usable by the =
general=20
public.

I have passed along the previous comments, and am awaiting the results =
of=20
splitting the Access DB into a front end for reports and queries and a =
back=20
end for tables.

Ray Shapp


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx =
or MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the =
dropdown menu at the top.  This will allow you to unsubscribe your email =
address or change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

If you are using Outlook and you see a lot of unnecessary code in your =
email messages, read these instructions that explain why and how to fix =
it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the dropdown 
menu at the top.  This will allow you to unsubscribe your email address or 
change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

If you are using Outlook and you see a lot of unnecessary code in your email 
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

Other related posts:

  • » [mso] Re: Make Access DB Read Only :VSMail mx1