This example creates a new User object and sets the Name, PID, and Password properties for the new object before appending it to the Users collection.
Cstring strCriteria;
CdbBookmark varSaveHere;
CdbDBEngine DBEng;
CdbUser usrMyself;
CdbWorkspace wrkDefault;
//...
wrkDefault = DBEng.Workspaces[0L]; // ' Get default workspace.
// Create, specify, and append new User object.
usrMyself = wrkDefault.CreateUser(_T("Pat Smith"));
usrMyself.SetPID(_T("abc123DEF456"));
usrMyself.SetPassword(_T("MySecret"));
wrkDefault.Users.Append(usrMyself);