Connecting a work group

teel73

Registered User.
Local time
Yesterday, 22:17
Joined
Jun 26, 2007
Messages
205
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:
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.
 

Users who are viewing this thread

Back
Top Bottom