Add Method (PIGroups collection)

               

 

The Add method creates a new PIGroup object and attaches it to the Server.PIGroups collection. The method returns a reference to the PIGroup object created.

 

Syntax

object.Add Name, Description

The Add method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIGroups collection obtained from a Server object.

Name

A string representing the name for the new user group.

Description

A string containing a description to be associated with the new user group

 

Remarks

Adding a user group to the Server will only succeed if the caller has write access to the user database on the server. This access is controlled through server specific means to maintain an environment with the desired level of security. For PI on Windows NT or UNIX servers this access is specified in the DBSecurity table.

 

Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:

Error

Description

pseACCESSDENIED

Caller does not have sufficient privilege to add a new PIUser

pseNOEMPTYSTRINGS

The group name may not be blank.

pseGROUPEXISTS

A group by this name already exists on the server.

pseGROUPINSTANTIATE

Unable to create a PIGroup object in memory. May be out of memory.

psePIGROUPCREATE

Unable to create a PIGroup on the server. See the error description field for more information.

Enabling Operational Intelligence