473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

A97: If I create a new user with CreateUser Method, is she automatically a member of Users group?

MLH
A97: If I create a new user with CreateUser Method, is she
automatically a member of Users group? Or, do I have to
append her to that group?
Nov 13 '05 #1
4 2065
"MLH" <CR**@NorthState.net> wrote in message
news:b6********************************@4ax.com...
A97: If I create a new user with CreateUser Method, is she
automatically a member of Users group? Or, do I have to
append her to that group?


After you create and append the new user to the users collection you can do
MsgBox usr.Groups.Count
Which will tell you that the new user is not a member of any groups. This
contrasts to when you create a new user with the workgroup administrator -
here they are automatically appende to the Users group. In DAO you have to
explicitly do this - and the syntax might not be obvious - look at how you
need two lots of CreateUser:

Private Sub AddUser()

On Error GoTo Err_Handler

Dim wks As DAO.Workspace
Dim usr As DAO.User
Dim grp As DAO.Group

Set wks = DBEngine.Workspaces(0)

Set usr = wks.CreateUser("MyUser", "MyPID", "MyPassword")

wks.Users.Append usr

wks.Users.Refresh

Set grp = wks.Groups("Users")

Set usr = grp.CreateUser("MyUser")

grp.Users.Append usr

grp.Users.Refresh

Exit_Handler:

On Error Resume Next

Set usr = Nothing

Set grp = Nothing

Set wks = Nothing

Exit Sub

Err_Handler:
MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
Resume Exit_Handler

End Sub
Nov 13 '05 #2
MLH
<snip>
Yes, I noticed CreateUser being used twice. Was difficult to grasp.
Thx for reply.

After you create and append the new user to the users collection you can do
MsgBox usr.Groups.Count
Which will tell you that the new user is not a member of any groups. This
contrasts to when you create a new user with the workgroup administrator -
here they are automatically appende to the Users group. In DAO you have to
explicitly do this - and the syntax might not be obvious - look at how you
need two lots of CreateUser:

Private Sub AddUser()

On Error GoTo Err_Handler

Dim wks As DAO.Workspace
Dim usr As DAO.User
Dim grp As DAO.Group

Set wks = DBEngine.Workspaces(0)

Set usr = wks.CreateUser("MyUser", "MyPID", "MyPassword")

wks.Users.Append usr

wks.Users.Refresh

Set grp = wks.Groups("Users")

Set usr = grp.CreateUser("MyUser")

grp.Users.Append usr

grp.Users.Refresh

Exit_Handler:

On Error Resume Next

Set usr = Nothing

Set grp = Nothing

Set wks = Nothing

Exit Sub

Err_Handler:
MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
Resume Exit_Handler

End Sub


Nov 13 '05 #3
On Mon, 06 Jun 2005 17:50:04 -0400, MLH <CR**@NorthState.net> wrote:
A97: If I create a new user with CreateUser Method, is she
automatically a member of Users group? Or, do I have to
append her to that group?

Hi
Try it and see?
David

Nov 13 '05 #4
MLH
You're right. Best way is to
try it and see. I did. New users
are automatically appended to
the Users group - but not to any
other groups.

Thx.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi
Try it and see?
David


Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
3
by: MLH | last post by:
I was running the following code while logged in as a user belonging only to the Users group. Set usrNew = .CreateUser(Me!UserID) 'The user ID is in a control on the form usrNew.PID =...
2
by: MLH | last post by:
I have not yet tried running this code in Access 97. It was ported from Access 2.0. It fails to compile, failing on the line xxxxxxxxxxxxxxxxxxx Function MakeUsersFromTable(TableName As String,...
11
by: MLH | last post by:
I was reading up on A97 security and found a blurb saying Microsoft Access provides two traditional methods of securing a database: setting a password for opening a database, or user-level...
1
by: VB Programmer | last post by:
I am using personalization/profile to store info for the user that is not contained in the aspnet_Users or aspnet_Membership tables. This info includes, firstname, lastname, and phonenumber. ...
2
by: Michael | last post by:
Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The...
3
by: John | last post by:
Hi I have a web service asmx file in a sub folders of site app root folder. With in the web service I am trying to cerate the user as below; <WebMethod()_ Public Function CreateUser(ByVal...
6
by: tombsy | last post by:
Hello Group. I work for a company who is about to embark on a long awaited Office upgrade from Office 97 to Office XP. Office XP comes with Access 2002. I am an accomplished Access developer...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.