Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: How to set the User Level Security with Access


Message #1 by "Planamente Michael" <Michael.Planamente@X...> on Tue, 17 Jul 2001 13:03:27
Hi,

I tried to set up the security with access (I want my database file .mdb 

to be secured, I want anybody to log in when he opens the file, the user 

acount must be attached to the mdb file) I took a look in the help of 

Access and saw that the way is to set up the user level security.



When I ran the user level security wizard, It created the workgroup file 

and after that, I could not do nothing with the secured mdb file.

I've verified the differents accounts(Admins, user...) I'm logged as an 

admin but access tells me that i have no rights on this DB ???



Can you help me please. Any suggestion is wellcome. 



the aim is to create a user "XYZ" With a password "xwz". when I open or 

connect to the DB via C++ or VB(DAO,ODBC), I want the DB to be password 

protected with login acount. this protection should not be attached to 

Access but to the mdb file itself...



I'm quite new with that then Can you give me a step by step procedure to 

make it run? thank you.



Planamente Michael
Message #2 by m.noordegraaf@a... on Tue, 17 Jul 2001 14:34:23
Hi,



Maybe the answer is in the Ms Access security faq. Take a look at 

microsoft.com to find it.

Micha



> Hi,

> I tried to set up the security with access (I want my database file .mdb 

> to be secured, I want anybody to log in when he opens the file, the user 

> acount must be attached to the mdb file) I took a look in the help of 

> Access and saw that the way is to set up the user level security.

> 

> When I ran the user level security wizard, It created the workgroup file 

> and after that, I could not do nothing with the secured mdb file.

> I've verified the differents accounts(Admins, user...) I'm logged as an 

> admin but access tells me that i have no rights on this DB ???

> 

> Can you help me please. Any suggestion is wellcome. 

> 

> the aim is to create a user "XYZ" With a password "xwz". when I open or 

> connect to the DB via C++ or VB(DAO,ODBC), I want the DB to be password 

> protected with login acount. this protection should not be attached to 

> Access but to the mdb file itself...

> 

> I'm quite new with that then Can you give me a step by step procedure to 

> make it run? thank you.

> 

> Planamente Michael
Message #3 by "Darron Michael" <darron.michael@h...> on Tue, 17 Jul 2001 14:39:04
A wizard named Tom Hamilton provided me with the following code.  It will 

read the users' login from the registry.  You can create a table with 

usernames and their permissions.  If you're willing to keep your users 

captive in forms, it's a pretty sharp solution.  You can enable or disable 

buttons on forms based on their network login.  I'm using this solution 

for our paint formulation database, our Production Scheduling and Tracking 

database and our In-Process Inspection Database.



HTH

8^)

Darron





' In the Declarations section

Declare Function GetComputerName& Lib "kernel32.dll" _

		                 Alias "GetComputerNameA" (ByVal lpBuffer 

As String, _

		                 nSize As 

Long)                                        ' Network CPU Name



Declare Function GetUserName& Lib "advapi32.dll" _

                 		Alias "GetUserNameA" (ByVal lpBuffer As 

String, _

                 		nSize As 

Long)                                         ' Network login name



Public Const MAX_COMPUTERNAME_LENGTH = 15                   	 ' Varies 

with platform OS





Function sGetUser() As String                             ' Returns 

current network logon

'   Usage:      ="Network User Name: " & sGetUser()

    Dim s$, cnt&, dl&, sWho As String

    cnt& = 199

    s$ = String$(200, 0)

    dl& = GetUserName(s$, cnt)

    sGetUser = Left$(s$, cnt - 1)

End Function



Function sGetComputer()                                   ' Returns 

network name of computer

'   Usage:      ="Computer Name: " & sGetComputer()

    Dim s$

    s$ = String$(MAX_COMPUTERNAME_LENGTH + 1, 0)

    Dim dl&

    Dim sz&

    sz& = MAX_COMPUTERNAME_LENGTH + 1

    dl& = GetComputerName(s$, sz)

    sGetComputer = Left$(s$, sz)

End Function



Public Function sGetUserID()                              ' Currently 

(Access) logged user

'   Usage:      ="Access User ID: " & sGetUserID()

    sGetUserID = CurrentUser()

End Function





> Hi,

> I tried to set up the security with access (I want my database file .mdb 

> to be secured, I want anybody to log in when he opens the file, the user 

> acount must be attached to the mdb file) I took a look in the help of 

> Access and saw that the way is to set up the user level security.

> 

> When I ran the user level security wizard, It created the workgroup file 

> and after that, I could not do nothing with the secured mdb file.

> I've verified the differents accounts(Admins, user...) I'm logged as an 

> admin but access tells me that i have no rights on this DB ???

> 

> Can you help me please. Any suggestion is wellcome. 

> 

> the aim is to create a user "XYZ" With a password "xwz". when I open or 

> connect to the DB via C++ or VB(DAO,ODBC), I want the DB to be password 

> protected with login acount. this protection should not be attached to 

> Access but to the mdb file itself...

> 

> I'm quite new with that then Can you give me a step by step procedure to 

> make it run? thank you.

> 

> Planamente Michael
Message #4 by "Pardee, Roy E" <roy.e.pardee@l...> on Tue, 17 Jul 2001 07:36:36 -0700
Jet needs to have a reference to the workgroup information file (the .mdw

created by the wizard) that contains the user accounts granted access to the

.mdb.  When you're just using access, you can specify the .mdw using the

/WRKGRP switch (e.g., you set up a shortcut with target <<msaccess.exe>>

/WRKGRP c:\MyWIF.mdw).



When you're opening the .mdb file up in (DAO) code, you specify the path to

the .mdw using the DBEngine object, like so:



Dim wk As DAO.Workspace

Dim db As DAO.Database

   

   With DAO.DBEngine

      .SystemDB = "c:\MyWIF.mdw"

      .DefaultUser = InputBox("Username")

      .DefaultPassword = InputBox("Password")

   End With



   Set wk = DAO.DBEngine.CreateWorkspace("bubba")

   Set db = wk.OpenDatabase("c:\MySecuredMDB.mdb")



HTH,



-Roy





-----Original Message-----

From: Planamente Michael [mailto:Michael.Planamente@X...]

Sent: Tuesday, July 17, 2001 6:02 AM

To: Access

Subject: [access] How to set the User Level Security with Access





Hi,

I tried to set up the security with access (I want my database file .mdb 

to be secured, I want anybody to log in when he opens the file, the user 

acount must be attached to the mdb file) I took a look in the help of 

Access and saw that the way is to set up the user level security.



When I ran the user level security wizard, It created the workgroup file 

and after that, I could not do nothing with the secured mdb file.

I've verified the differents accounts(Admins, user...) I'm logged as an 

admin but access tells me that i have no rights on this DB ???



Can you help me please. Any suggestion is wellcome. 



the aim is to create a user "XYZ" With a password "xwz". when I open or 

connect to the DB via C++ or VB(DAO,ODBC), I want the DB to be password 

protected with login acount. this protection should not be attached to 

Access but to the mdb file itself...



I'm quite new with that then Can you give me a step by step procedure to 

make it run? thank you.



Planamente Michael



Message #5 by "Peter Kaufman" <kaufman@l...> on Wed, 18 Jul 2001 19:00:03 +0700
You mention both password protection and user level security - two different

things. User level security requires using the workgroup file. If you

already understand this, then I apologize, but do get the security faq (I

think secfaq of secfaq97) from MS, which does have an excellent step by step

procedure to implement security.



Peter



> -----Original Message-----

> From: Planamente Michael [mailto:Michael.Planamente@X...]

> Sent: Tuesday, July 17, 2001 1:03 PM

> To: Access

> Subject: [access] How to set the User Level Security with Access

>

>

> Hi,

> I tried to set up the security with access (I want my database file .mdb

> to be secured, I want anybody to log in when he opens the file, the user

> acount must be attached to the mdb file) I took a look in the help of

> Access and saw that the way is to set up the user level security.

>

> When I ran the user level security wizard, It created the workgroup file

> and after that, I could not do nothing with the secured mdb file.

> I've verified the differents accounts(Admins, user...) I'm logged as an

> admin but access tells me that i have no rights on this DB ???

>

> Can you help me please. Any suggestion is wellcome.

>

> the aim is to create a user "XYZ" With a password "xwz". when I open or

> connect to the DB via C++ or VB(DAO,ODBC), I want the DB to be password

> protected with login acount. this protection should not be attached to

> Access but to the mdb file itself...

>

> I'm quite new with that then Can you give me a step by step procedure to

> make it run? thank you.

>

> Planamente Michael



>




  Return to Index