CdbGroup::CreateUser Method

Creates a new User object (Microsoft Jet workspaces only).

Syntax

CdbUserCreateUser(LPCTSTR pstrName=NULL,

LPCTSTR pstrPID=NULL,

LPCTSTR pstrPassword=NULL);

Parameters

Type Example Description
LPCTSTR pstrName Optional. A pointer to a string that uniquely names the new User object. See the Name property for details on valid User names.
LPCTSTR pstrPID Optional. A pointer to a string containing the PID of a user account. The identifier must contain from 4 to 20 alphanumeric characters. See the PID property for more information on valid personal identifiers.
LPCTSTR pstrPassword Optional. A pointer to a string containing the password for the new User object. The password can be up to 14 characters long and can include any characters except the ASCII character 0 (null). See the Password property for more information on valid passwords.

Usage

#include <afxole.h>
#include <dbdao.h>
CdbUser      us;
CdbGroup      grp;
...            // Initialize the group, etc.
            // Create a user in the group.
us = grp.CreateUser(   _T("Accountant"), _T("BOB_SMITH"),
                     _T("BOBSPASSWD");
grp.Users.Append( us );