Renames an existing object on the server or client object system.
Syntax
EsbRenameObject (hCtx, ObjType, AppName, DbName, ObjName, nObjName); ByVal hCtx As Long ByVal ObjType As Long ByVal AppName As String ByVal DbName As String ByVal ObjName As String ByVal nObjName As String
Parameter | Description |
---|---|
hCtx | VB API context handle. Can be local context handle returned by EsbCreateLocalContext(). |
ObjType | Object type (must be single type). Refer to Table 15 for a list of possible values. |
AppName | Application name. |
DbName | Database name. If an empty string, uses the application sub-directory. |
OldName | Old name of an object to rename. |
NewName | New name of the renamed object. See Object Name Limits. |
Notes
To rename an object, the object must not be locked, and the new object must not already exist.
Outline objects and LRO objects cannot be renamed.
Use the EsbRenameDatabase() function to rename a database, including its associated outline.
Objects cannot be renamed across different applications or databases. Use the EsbCopyObject() function to copy an object to another application or database.
Return Value
None.
Access
This function requires the caller to have application or database Design privilege (ESB_PRIV_APPDESIGN or ESB_PRIV_DBDESIGN) for the specified application or database containing the object.
Example
Declare Function EsbRenameObject Lib "ESBAPIN" (ByVal hCtx As Long, ByVal ObjType As Integer, ByVal AppName As String, ByVal DbName As String, ByVal OldName As String, ByVal NewName As String) As Long Sub ESB_RenameObject () Dim sts As Long Dim AppName As String Dim DbName As String Dim OldName As String Dim NewName As String Dim ObjType As Integer AppName = "Sample" DbName = "Basic" OldName = "Basic" NewName = "NewBasic" ObjType = ESB_OBJTYPE_OUTLINE '******************** ' Rename Rules Object '******************** sts = EsbRenameObject (hCtx, ObjType, AppName, DbName, OldName, NewName) End Sub
See Also