EsbCreateLocationAlias

Creates a new location alias; that is, it maps an alias name string to an ordered set of the following five strings: host name, application name, database name, user login name, and user password.

Syntax

EsbCreateLocationAlias (hCtx, AliasName, HostName, _
                        AppName, DbName, Login, Password)
ByVal hCtx      As Long
ByVal AliasName As String
ByVal HostName  As String
ByVal AppName   As String
ByVal DbName    As String
ByVal Login     As String
ByVal Password  As String
ParameterDescription

hCtx

API context handle

AliasName

Location alias

HostName

Target host

AppName

Target application

DbName

Target database

Login

User login name

Password

User password

Return Value

Returns an error if a location alias with the name AliasName already exists.

Example

Public Sub LocationAliasTest()

  Dim status    As Long
  Dim ListCount As Integer
  Dim Aliases   As Variant
  Dim HostNames As Variant
  Dim AppNames  As Variant
  Dim DbNames   As Variant
  Dim UserNames As Variant

  status = EsbCreateLocationAlias(hCtx, "blah1", "LocalHost", "Demo", "Basic", _
                                "admin", "password")
  If (status <> 0) Then
    MsgBox "Create routine Failed"
    Exit Sub
  End If
    
  status = EsbCreateLocationAlias(hCtx, "blah2", "LocalHost", "Demo", "Basic", _
                                  "admin", "password")
  If (status <> 0) Then
    MsgBox "Create routine Failed"
    Exit Sub
  End If
    
  status = EsbGetLocationAliasList(hCtx, ListCount, Aliases, HostNames, _
                                   AppNames, DbNames, UserNames)
  If (status <> 0) Then
    MsgBox "Get routine Failed"
    Exit Sub
  End If
    
  If (ListCount > 0) Then
        ' Retrieve the elements as Aliases(0) to Aliases(ListCount -1)
  End If

  status = EsbDeleteLocationAlias(hCtx, "blah1")
  If (status <> 0) Then
    MsgBox "Delete routine Failed"
    Exit Sub
  End If

  status = EsbGetLocationAliasList(hCtx, ListCount, Aliases, HostNames, _
                                   AppNames, DbNames, UserNames)
  If (status <> 0) Then
    MsgBox "Get routine Failed"
    Exit Sub
  End If
End Sub

See Also