By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

code to add user to workgroup

P: 10
how to create a user from a form ???
i looked in help and i find something like this :
CREATE USER user password pid [, user password pid, ]
but i don't get it
how do the corect CREATE USER declaration looks ?

can you help mi with that problem ?
Feb 17 '07 #1
Share this Question
Share on Google+
8 Replies


ADezii
Expert 5K+
P: 8,597
how to create a user from a form ???
i looked in help and i find something like this :
CREATE USER user password pid [, user password pid, ]
but i don't get it
how do the corect CREATE USER declaration looks ?

can you help mi with that problem ?
To create a New User named John Doe with no Password, and to make him a member of the Admins Group:
Expand|Select|Wrap|Line Numbers
  1. Dim MyWks As Workspace, MyUser As User
  2. Set MyWks = DBEngine.Workspaces(0)
  3.  
  4. With MyWks
  5.   'Create and Append the New User John Doe
  6.   Set MyUser = .CreateUser("John Doe")
  7.     MyUser.PID = "B6TFRE45"     'Unique Identifier
  8.     MyUser.Password = ""        'No Password
  9.     .Users.Append MyUser
  10.   'Make the User John Doe a member of the Admins Group by creating
  11.   'and adding the User Object to the Admin's Group Users collection
  12.   Set MyUser = .Groups("Admins").CreateUser("John Doe")
  13.   .Groups("Admins").Users.Append MyUser
  14. End With
Feb 17 '07 #2

P: 10
its working but when i try to login i get a message:
Record(s) cannot be read; no read permission on "MySysAccessObjects"
?????
Feb 18 '07 #3

ADezii
Expert 5K+
P: 8,597
its working but when i try to login i get a message:
Record(s) cannot be read; no read permission on "MySysAccessObjects"
?????
I'm not really sure why you are getting this Error Message - perhaps it has something to do with restrictions applied to the Admins Group. I'll investigate further.
Feb 19 '07 #4

P: 10
i add user to the new created group not to the admins group
Feb 19 '07 #5

P: 10
i dont have permission to the system tables in security.mdw
only the enginer have it
Feb 19 '07 #6

P: 10
now i know why it dont works
i had to add every created user to the users group
Thnak's for your help ADezii
Feb 19 '07 #7

P: 10
i need one more thing
something in VB to change users password and to log out a user ?
Feb 19 '07 #8

ADezii
Expert 5K+
P: 8,597
i need one more thing
something in VB to change users password and to log out a user ?
Not VB but SQL:
Expand|Select|Wrap|Line Numbers
  1. ALTER USER <UserName> PASSWORD <NewPassword> <OldPassword>
Feb 20 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.