CharlieT302
Instructor
Hello,
I have a database that is written in a 2003 format in order to take advantage of user accounts. I need to set up a user form to allow for easier creation of user accounts and to assign them to groups. With this in mind, I have two questions:
First,
The initial code that specifies the username, password, and PID works fine.
CurrentProject.Connection.Execute "CREATE USER Rsmith pword 12345;"
However, I would like to be able to replace those values with a field reference on an entry form, so that the administrator can dynamically choose a user account, group, etc. I have tried several variations and cannot get the code to read the form.
Any variation of the code below has not worked.
Seoondly, I would like to view, from the database file, the contents of the MSysGroupList and MSysUserList tables; which are in the workgroup file (.mdw). The intent is to display the user and group accounts in a list box so the administrator can more easily assign users to group account simply by selecting the desired account from the list. How can I view these lists from the database file?
I have a database that is written in a 2003 format in order to take advantage of user accounts. I need to set up a user form to allow for easier creation of user accounts and to assign them to groups. With this in mind, I have two questions:
First,
The initial code that specifies the username, password, and PID works fine.
CurrentProject.Connection.Execute "CREATE USER Rsmith pword 12345;"
However, I would like to be able to replace those values with a field reference on an entry form, so that the administrator can dynamically choose a user account, group, etc. I have tried several variations and cannot get the code to read the form.
Any variation of the code below has not worked.
Code:
Dim usrNew, grpNew, passnew, PidNew
usrNew = Me.NewUser
grpNew = Me.NewGroup
passnew = "password"
PidNew = usrNew & "23"
CurrentProject.Connection.Execute "CREATE USER [usrNew] pword [PidNew];"
CurrentProject.Connection.Execute "ADD USER usrNew TO grpnew;"
Seoondly, I would like to view, from the database file, the contents of the MSysGroupList and MSysUserList tables; which are in the workgroup file (.mdw). The intent is to display the user and group accounts in a list box so the administrator can more easily assign users to group account simply by selecting the desired account from the list. How can I view these lists from the database file?