ArcObjects Library Reference (Location)  

IInitGeocodeServer.AttachToLocator Method

Attach this service to the locator specified by the locator name. This is the locator that the service will use internally.

[Visual Basic .NET]
Public Sub AttachToLocator ( _
    ByVal locName As ILocatorName _
)
[C#]
public void AttachToLocator (
    ILocatorName locName
);
[C++]
HRESULT AttachToLocator(
  ILocatorName* locName
);
[C++]

Parameters

locName [in]

  locName is a parameter of type ILocatorName

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

To create a new GeocodeServer in a Desktop or Engine environment, simply create a new GeocodeServer object and attach the address locator on which you want to base the GeocodeServer using the AttachToLocator method.

    Dim pLocatorManager As esriLocation.ILocatorManager
    Dim pLocatorWorkspace As esriGeoDatabase.ILocatorWorkspace
    Dim pLocatorName As esriGeoDatabase.ILocatorName
    Dim pInitGeocodeServer As esriLocation.IInitGeocodeServer
    
    '+++ get a reference to the locator on which to base the GeocodeServer
    Set pLocatorManager = New esriLocation.LocatorManager
    Set pLocatorWorkspace = _
        pLocatorManager.GetLocatorWorkspaceFromPath("D:\Workspace\ArcGIS Developer Help\GeocodeServer")
    Set pLocatorName = pLocatorWorkspace.GetLocatorName("Redlands Streets")
    
    '+++ create a new GeocodeServer
    Set pInitGeocodeServer = New esriLocation.GeocodeServer
    pInitGeocodeServer.AttachToLocator pLocatorName

See Also

IInitGeocodeServer Interface