ArcObjects Library Reference  (Server)    

IServerObjectAdmin CreateConfiguration Example

[Visual Basic 6.0]

The following VB code shows how to connect to the ArcGIS Server called "melange", and use the CreateConfiguration, AddConfiguration and StartConfiguration methods to create a new geocode server object configuration, add it to the server and make it available for use:

  Dim pGISServerConnection As IGISServerConnection
  Set pGISServerConnection = New GISServerConnection
  pGISServerConnection.Connect "melange"
  
  Dim pServerObjectAdmin As IServerObjectAdmin
  Set pServerObjectAdmin = pGISServerConnection.ServerObjectAdmin
  
  ' create the new configuration
  Dim pConfiguration As IServerObjectConfiguration
  Set pConfiguration = pServerObjectAdmin.CreateConfiguration
  
  pConfiguration.Name = "California"
  pConfiguration.TypeName = "GeocodeServer"
  
  Dim pProps As IPropertySet
  Set pProps = pConfiguration.Properties
  pProps.SetProperty "LocatorWorkspacePath", "\\melange\Geocoding\California"
  pProps.SetProperty "Locator", "California"
  pProps.SetProperty "SuggestedBatchSize", "500"
  
  pConfiguration.IsPooled = True
  pConfiguration.MinInstances = 1
  pConfiguration.MaxInstances = 1

  pConfiguration.WaitTimeout = 10
  pConfiguration.UsageTimeout = 120

 ' add the configuration to
  the server pServerObjectAdmin.AddConfiguration pConfiguration
  
  ' start the configuration
  pServerObjectAdmin.StartConfiguration pConfiguration.Name, pConfiguration.TypeName

[Visual Basic .NET, C#, C++]
No example is available for Visual Basic .NET, C#, or C++. To view a Visual Basic 6.0 example, click the Language Filter button Language Filter in the upper-left corner of the page.