I am trying to add users to a MDW file thru VBA. The MDW file is not the current MDW I'm attached to. I figured that I would just have to create a wor
Here's my code:
This adds the user to the workgroup I'm currently connected to. I want to add the user to the specified workgroup (MDW). Can someone tell me what I'm doing wrong?
Thanks in advance.
Here's my code:
Code:
Dim BWS As Workspace
Dim BiMDW As String
Dim usr As User
Dim grp As group
DBEngine.SystemDB = "C:\Documents and Settings\e3utbl\Desktop\Devl Databases\ContractorsDbaseStuff\CONBISec.mdw"
Set BWS = DBEngine.CreateWorkspace("", "e3utbl", "elmo1zoi", dbUseJet)
Set usr = BWS.CreateUser("r7upbl", "56989")
BWS.Users.Append usr
Set grp = usr.CreateGroup("Users")
usr.Groups.Append grp
DoEvents
usr.Groups.Refresh
MsgBox "Profile was created successfully"
BIWkspace.Close
This adds the user to the workgroup I'm currently connected to. I want to add the user to the specified workgroup (MDW). Can someone tell me what I'm doing wrong?
Thanks in advance.