PC Review


Reply
Thread Tools Rate Thread

Adding Users with code

 
 
=?Utf-8?B?SmFtZXMgU3RlcGhlbnM=?=
Guest
Posts: n/a
 
      4th Mar 2005
I found this code on google to add users, I set it up to receive the three
variables from my form. When I run it I get an error: Type Mismatch

Does anybody have an idea as to what I am doing wrong? It seems fairly
straightforward, but it doesn't work, and I can't figure out why. I have
searched all through the group and I cant find anybody having this problem.

Dim ws As Workspace, usr As User
txtLoginName = Me.NewUser
txtPassword = Me.NewPassword
txtPID = Me.NewPID

' Create and append new User
Set ws = DBEngine.Workspaces(0)
Set usr = ws.CreateUser("NewUserName", "000134", "NU123")
ws.Users.Append usr

' Add user to the Users group
With ws.Groups("Full Data Users")
Set usr = .CreateUser(txtLoginName)
.Users.Append usr
End With


Thanks,
James Stephens

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
code to prevent users from adding new worksheets jat Microsoft Excel Worksheet Functions 2 18th Mar 2009 08:24 PM
Help - Automating a file.. Adding Users , Deleting users, Changing =?Utf-8?B?VGltIEhhcmRpbmc=?= Microsoft Excel Worksheet Functions 0 16th Mar 2005 01:25 PM
Adding Domain Users group to local Power Users JohnB Microsoft Windows 2000 Active Directory 1 1st Sep 2004 08:57 PM
Adding Domain Users Global Group to Power Users localgroup Phill H. Microsoft Windows 2000 1 24th Jul 2003 05:21 PM
Adding users to work Group file with the help of code Ashutosh Microsoft Access Security 2 14th Jul 2003 08:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:56 AM.