Copy Method  
 

Copy the contents of a stored object to another container.

Syntax

object.Copy( OldLabel, NewLabel [, StorageType] )

Parameters

OldLabel
A string which specifies the label of the object that should be copied.
NewLabel
A string which specifies the new label for the copied object.
StorageType
A numeric value that identifies the storage container type. One of the following values should be specified. If this parameter is omitted, the object will be copied within the current container.
Value Constant Description
1 webStorageGlobal Global storage. Objects stored using this storage type are available to all users. Any changes made to objects using this storage type will affect all users of the application. Unless there is a specific need to limit access to the objects stored by the application to specific domains, local machines or users, it is recommended that you use this storage type when creating new objects.
2 webStorageDomain Local domain storage. Objects stored using this storage type are only available to users in the same local domain, as defined by the domain name or workgroup name assigned to the local system. If the domain or workgroup name changes, objects previously stored using this storage type will not be available to the application.
3 webStorageMachine Local machine storage. Objects stored using this storage type are only available to users on the same local machine. The local machine is identified by unique characteristics of the system, including the boot volume GUID. Objects previously stored using this storage type will not be available on that system if the boot disk is reformatted.
4 webStorageUser Current user storage. Objects stored using this storage type are only available to the current user logged in on the local machine. The user identifier is based on the Windows user SID that is assigned when the user account is created. If the user account is deleted, the objects previously stored using this storage type will not be available to the application.

Return Value

A value of True is returned if the object was copied. Otherwise, a value of False is returned and the LastError property will return the specific cause of the failure.

Remarks

The Copy method is used to create a copy of an existing storage object. It may be used to duplicate an object with a different label, or it may be used to copy the object to a new storage container type. For example, it can copy an object originally created in the webStorageUser container to a new object stored in the webStorageMachine container.

Copied objects are assigned their own unique ID and are not linked to one another. Any subsequent changes made to the original object will not affect the copied object. Attempting to copy an object to itself or another existing object will result in an error.

This method updates the current object. Various properties such as ObjectId and ObjectLabel will reflect the values associated with the new, copied object and not the original object it was copied from.

See Also

Delete Method, Move Method, Rename Method