I got this sample function from Microsoft knowledge Base Article - 210331
I did exactly that and I got error 3029 which returns its custom message "The account used to create the workspace does not exist"
My question, how do I correct this error?
the function:
Function CurrentUserInGroup(GroupName As String)
'****************************************************************
' Purpose: Determines if the current user belongs to the specified
' group.
' Accepts: The name of a group.
' Returns: True if the current user is a member of the specified
' group, False if the current user is not a member of
' the group.
' Assumes: The existence of a user called Developer in the Admins
' group, with no password.
'****************************************************************
On Error GoTo err_CurrentUserInGroup
Dim MyWorkSpace As Workspace, i As Integer
Dim MyGroup As Group, MyUser As User
' Create a new workspace as a member of the Admins group.
Set MyWorkSpace = DBEngine.CreateWorkspace("SPECIAL", "Developer", ""
Set MyGroup = MyWorkSpace.Groups(GroupName)
Set MyUser = MyWorkSpace.Users(CurrentUser())
For i = 0 To MyGroup.Users.Count - 1
If MyGroup.Users(i).Name = MyUser.Name Then
CurrentUserInGroup = True
Exit Function
End If
Next i
CurrentUserInGroup = False
MyWorkSpace.Close
Exit Function
err_CurrentUserInGroup:
If Err = 3265 Then
MsgBox UCase(GroupName) & " isn't a valid group name", 16, "Error"
CurrentUserInGroup = False
ElseIf Err = 3029 Then
MsgBox "The account used to create the workspace does not exist"
Else: MsgBox Error(Err)
End If
MyWorkSpace.Close
Exit Function
End Function
I did exactly that and I got error 3029 which returns its custom message "The account used to create the workspace does not exist"
My question, how do I correct this error?
the function:
Function CurrentUserInGroup(GroupName As String)
'****************************************************************
' Purpose: Determines if the current user belongs to the specified
' group.
' Accepts: The name of a group.
' Returns: True if the current user is a member of the specified
' group, False if the current user is not a member of
' the group.
' Assumes: The existence of a user called Developer in the Admins
' group, with no password.
'****************************************************************
On Error GoTo err_CurrentUserInGroup
Dim MyWorkSpace As Workspace, i As Integer
Dim MyGroup As Group, MyUser As User
' Create a new workspace as a member of the Admins group.
Set MyWorkSpace = DBEngine.CreateWorkspace("SPECIAL", "Developer", ""
Set MyGroup = MyWorkSpace.Groups(GroupName)
Set MyUser = MyWorkSpace.Users(CurrentUser())
For i = 0 To MyGroup.Users.Count - 1
If MyGroup.Users(i).Name = MyUser.Name Then
CurrentUserInGroup = True
Exit Function
End If
Next i
CurrentUserInGroup = False
MyWorkSpace.Close
Exit Function
err_CurrentUserInGroup:
If Err = 3265 Then
MsgBox UCase(GroupName) & " isn't a valid group name", 16, "Error"
CurrentUserInGroup = False
ElseIf Err = 3029 Then
MsgBox "The account used to create the workspace does not exist"
Else: MsgBox Error(Err)
End If
MyWorkSpace.Close
Exit Function
End Function