Results 1 to 12 of 12
  1. #1
    Join Date
    Dec 2003
    Location
    Delaware
    Posts
    7

    Unhappy Unanswered: HEEELLLLPP...need to "redirect" system.mdw

    I have a slight problem, I am creating a database that will be used on a shared drive at my work...everything is fine with it...on my comp. The problem is, when you use someone else's computer it doesn't ask you to log on, even though I already set up the group/user/permission stuff. I eventually figured out that it was the system.mdw file that is controlling this and on someone else's computer it doesn't ask for any user name or password. I was wondering if there is some way I can "redirect" that persons access when they open up my database on the shared drive to look at a system.mdw file that I can put on the shared drive with my database. Thanks for anyhelp, I am a little new to this so please to to explain in terms that I would most likely understand. Also, I am running Access 97 and have Win98. Thanks again!

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Yes. Run the WorkGroup Administrator program on the client PC ... It is found in the MSAccess directory.

  3. #3
    Join Date
    Dec 2003
    Location
    Delaware
    Posts
    7

    Post

    How would every person using the database, start with that workgroup file so they could login, and then after they closed my database not have to worry about logging in to access anymore until they use mine again. I'm not sure if thats how this works...thanks for your help!

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    That is not how it works ... When you use this program it sets the .mdw to be used for logging into ALL access databases on that machine regardless of where the physical DB resides (network, or otherwise) ... This is setup once ...

  5. #5
    Join Date
    Dec 2003
    Location
    Delaware
    Posts
    7
    Originally posted by M Owen
    That is not how it works ... When you use this program it sets the .mdw to be used for logging into ALL access databases on that machine regardless of where the physical DB resides (network, or otherwise) ... This is setup once ...
    Ok I see what your saying, but the problem is it will be running on other machines, so how do I incorporate it to the other machines (only while my DB is open)? ...thanks again

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    it? Each machine that you want to have login requirements should be reconfig'd to the ???.mdw that you want ...

  7. #7
    Join Date
    Dec 2003
    Location
    Budapest, HU
    Posts
    18

    Exclamation

    Yes, M Owen is right, when you install Access, the default .mdw file is usually %SystemDir%\system.mdw, or %UserProfilePath%\system.mdw. And if you join to an .mdw file, it will be applied to ALL Access databases running on that particular machine.
    But!
    YOU CAN CREATE an other .mdw file by using the Workgroup Administrator, and you can tell any Access database to be opened with a particular .mdw file.

    Follow the steps below:
    1. Open your database you wish to secure.
    2. Create a new .mdw file using the Workgroup Administrator, and stay joined to it.
    3. Create the user groups, users, and set permissions etc.
    4. Create a User into the Admins group, and grant full access to everything for this new user.
    5. Close the database.
    6. Open the database again, and log on as the new administrator User.
    7. Take the ownership of all objects in the database.
    8. Restrict all rights of the ORIGINAL Admin user.
    9. Set a password. (When you create a user it's default password is blank.)
    10. Run the User-level security wizard (honestly, I don't remember if A97 has this wizard). This is the step when your database will be really secured. The wizard will make a backup copy of your unsecured database, so if you realized later that something's wrong with the permissions, you can rethink and modify them.
    11. Open Access with an other, or a blank database. It will require password, that's normal. Log on as the new administrator user.
    12. Join to the default .mdw file NOW, and close the database.

    In this way, if you open your secured database, it will open with the default .mdw file. If you have restricted the default Admin user's rights as I told in point 7. and 8. above, then you will not be able to make any design changes, because now, you are that ORIGINAL Admin user.

    Afterall, Your secured database must be opened with the /wrkgrp switcher.

    So you need to create a shortcut to your secured database, and the target property of the shortcut should look like this: "C:\DataBases\MyDataBase.mdb" /wrkgrp "C:\DataBases\MyDataBase.mdw"

    Anyway, I strongly recommend to look at HELP for more information about securing a database.

    I hope this helps you all.

    BRegs,

    TBÁrpi

  8. #8
    Join Date
    Dec 2003
    Location
    Delaware
    Posts
    7
    Thanks! that was extremely helpful...i did a little bit of a variation on it though because it hit me how to make it work while i was reading what you said...created a new workgroup, I then moved it over to the shared drive with my DB...Then I secured it and everything..but I changed my MDW on my comp back to the original and the new one to put restrictions on the admin (not ask for a password), this way I don't have to log into all DB's just the one cause I made the shortcut...like you wrote, so now everyone who has admin as thier default user name...which they all do...would have to login and I can restrict them to what they can't do. This is good because I don't have to go around and manually change peoples comps...which I couldn't do anyway. Ideally I wanted people to be able to go in and change items in records freely...but I wanted to know who made the change and when, with this I can only tell when but not from who. If you have any suggestions on that....perhaps an alternate way for them to mandatory log on...outside of access' default login so they could go only my DB with the restrictions and then log on before they can go do anything else so I can know who makes changes. In any case, Thanks for the help!

  9. #9
    Join Date
    Dec 2003
    Location
    Budapest, HU
    Posts
    18
    To log all database activities so that you know which user did what you need to require user authentication, in other words mandatory log on.

    Create the users into that specific .MDW file you use to open your database with.

    You can add/remove users via VBA code. This is an example of adding a user. I just copied it from one of my old projects, so variable names should be changed of course. The code adds the user to the .MDW file and also adds the user to a table.

    '*****************
    Public Sub AddUser(strGroup As String, lngUserGroupID As Long, strUserName As String, _
    strLogonName As String, strPassword As String)

    On Error GoTo MyErr

    Dim wrkThisDB As DAO.Workspace
    Dim usrNew As DAO.User
    Dim usrTempUser As DAO.User
    Dim grpGroup As DAO.Group
    Dim DB As DAO.Database
    Dim RS As DAO.Recordset

    Set wrkThisDB = DBEngine.Workspaces(0)

    With wrkThisDB
    Set usrNew = .CreateUser(strLogonName, strLogonName, strPassword)
    usrNew.PID = strLogonName
    usrNew.Password = strPassword
    .Users.Append usrNew
    Set usrTempUser = .Groups(strGroup).CreateUser(strLogonName, strLogonName, strPassword)
    .Groups(strGroup).Users.Append usrTempUser
    Set usrTempUser = .Groups("Users").CreateUser(strLogonName, strLogonName, strPassword)
    .Groups("Users").Users.Append usrTempUser
    End With

    Set DB = CurrentDb
    Set RS = DB.OpenRecordset("tblOperator")
    With RS
    .AddNew
    ![Name] = strUserName
    !LogonName = strLogonName
    !NewPwd = True
    !UserGroupID = lngUserGroupID
    .Update
    .Close
    End With
    Set DB = Nothing

    MsgBox "User added." & Chr(10) & Chr(10) _
    & "Log on name: " & strLogonName & Chr(10) _
    & "User Group: " & strGroup & Chr(10) _
    & "Initial Password: '" & strPassword & "'" & Chr(10) & Chr(10) _
    & "Password must be changed at first logon!", vbInformation + vbOKOnly

    Bye:
    Exit Sub

    MyErr:
    msgbox err.number & ", " & err.description
    Resume Bye
    End Sub
    '*****************
    If you wish to log database activities, you can use Application.CurrentUser to capture the current user's logon name.

    Hope this makes sense.

    BRegs,

    TBÁrpi

  10. #10
    Join Date
    Dec 2003
    Location
    Delaware
    Posts
    7

    Post

    If there is anyway I could see an example of how this is applied I would extremely appriciate it..I lack the knowledge to fully understand this...If you can't thats fine too, don't worry about it...thanks either way!

  11. #11
    Join Date
    Dec 2003
    Location
    Delaware
    Posts
    7

    Post

    Originally posted by TBÁrpi
    To log all database activities so that you know which user did what you need to require user authentication, in other words mandatory log on.

    Create the users into that specific .MDW file you use to open your database with.

    You can add/remove users via VBA code. This is an example of adding a user. I just copied it from one of my old projects, so variable names should be changed of course. The code adds the user to the .MDW file and also adds the user to a table.

    '*****************
    Public Sub AddUser(strGroup As String, lngUserGroupID As Long, strUserName As String, _
    strLogonName As String, strPassword As String)

    On Error GoTo MyErr

    Dim wrkThisDB As DAO.Workspace
    Dim usrNew As DAO.User
    Dim usrTempUser As DAO.User
    Dim grpGroup As DAO.Group
    Dim DB As DAO.Database
    Dim RS As DAO.Recordset

    Set wrkThisDB = DBEngine.Workspaces(0)

    With wrkThisDB
    Set usrNew = .CreateUser(strLogonName, strLogonName, strPassword)
    usrNew.PID = strLogonName
    usrNew.Password = strPassword
    .Users.Append usrNew
    Set usrTempUser = .Groups(strGroup).CreateUser(strLogonName, strLogonName, strPassword)
    .Groups(strGroup).Users.Append usrTempUser
    Set usrTempUser = .Groups("Users").CreateUser(strLogonName, strLogonName, strPassword)
    .Groups("Users").Users.Append usrTempUser
    End With

    Set DB = CurrentDb
    Set RS = DB.OpenRecordset("tblOperator")
    With RS
    .AddNew
    ![Name] = strUserName
    !LogonName = strLogonName
    !NewPwd = True
    !UserGroupID = lngUserGroupID
    .Update
    .Close
    End With
    Set DB = Nothing

    MsgBox "User added." & Chr(10) & Chr(10) _
    & "Log on name: " & strLogonName & Chr(10) _
    & "User Group: " & strGroup & Chr(10) _
    & "Initial Password: '" & strPassword & "'" & Chr(10) & Chr(10) _
    & "Password must be changed at first logon!", vbInformation + vbOKOnly

    Bye:
    Exit Sub

    MyErr:
    msgbox err.number & ", " & err.description
    Resume Bye
    End Sub
    '*****************
    If you wish to log database activities, you can use Application.CurrentUser to capture the current user's logon name.

    Hope this makes sense.

    BRegs,

    TBÁrpi

    If there is anyway I could see an example of how this is applied I would extremely appriciate it..I lack the knowledge to fully understand this...If you can't thats fine too, don't worry about it...thanks either way!

  12. #12
    Join Date
    Dec 2003
    Location
    Budapest, HU
    Posts
    18
    The project is too complex to send it, but generally, create a form where you fill all the data needed to add a user, such as Logon name, initial password, user group etc. And create a button to click 'Add User' or like that, and insert the following code into the OnClick event handler of that button:

    AddUser [user_group], [user_group_id], [user_name], [logon_name], [init_password]

    where
    [user_group] is the name of the user group you wish the user to be belonged
    [user_group_id] is the ID of the user group you wish the user to be belonged
    [user_name] is the user's full name
    [logon_name] is the user's logon name
    [init_password] is the initial password for the user

    If you don't want to use [user_group_id] or [user_name] then simply delete these formal parameters and all their references from the function declaration and abandon it from the function call.

    What you need at least are [user_group], [logon_name] and [init_password].

    OK, let's see the code that only adds the user to the .MDW file but not the table:
    '*****************
    Public Sub AddUser(strGroup As String, strLogonName As String, strPassword As String)

    On Error GoTo MyErr

    Dim wrkThisDB As DAO.Workspace
    Dim usrNew As DAO.User
    Dim usrTempUser As DAO.User
    Dim grpGroup As DAO.Group

    Set wrkThisDB = DBEngine.Workspaces(0)

    With wrkThisDB
    Set usrNew = .CreateUser(strLogonName, strLogonName, strPassword)
    usrNew.PID = strLogonName
    usrNew.Password = strPassword
    .Users.Append usrNew
    Set usrTempUser = .Groups(strGroup).CreateUser(strLogonName, strLogonName, strPassword)
    .Groups(strGroup).Users.Append usrTempUser
    Set usrTempUser = .Groups("Users").CreateUser(strLogonName, strLogonName, strPassword)
    .Groups("Users").Users.Append usrTempUser
    End With

    MsgBox "User added." & Chr(10) & Chr(10) _
    & "Log on name: " & strLogonName & Chr(10) _
    & "User Group: " & strGroup & Chr(10) _
    & "Initial Password: '" & strPassword & "'" & Chr(10) & Chr(10) _
    & "Password must be changed at first logon!", vbInformation + vbOKOnly

    Bye:
    Exit Sub

    MyErr:
    msgbox err.number & ", " & err.description
    Resume Bye
    End Sub
    '*****************

    BRegs,

    TBÁrpi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •