Rename Method (PIContexts collection)

                

 

This method changes the name of an existing PIContext on the Server and in all the PIUsers currently associated with the particular PIContext.

 

Syntax

object.Rename OldName, NewName

The Rename method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIContexts collection.

OldName

A string containing the name of the existing PIContext to be renamed.

NewName

A string containing the new name for the PIContext.

 

Remarks

As renaming a PIContext changes the name for all PIUsers that have been previously associated with this context, the impact of this method on an application depending on the existence of certain contexts can be severe. Typically Rename is used to correct spelling errors or to replace a name with a more meaningful or more correct string. More often an application will want to create new contexts using PIContexts.Add and reference these new contexts rather than rename the existing set.

 

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 modify a PIContext.

pseNOEMPTYSTRINGS

The specified context names can not be empty or all blanks.

pseCONTEXTRENAME

Unable to rename the context on the server.

Enabling Operational Intelligence