VB gp
'// Intialize the Geoprocessor
Dim GP As IGeoProcessor
Set GP = New GeoProcessor
'// Set the input workspace environment
Dim sde As String
sde = "Database Connections/vampire.sde/LegalFabric"
GP.SetEnvironmentValue "workspace", sde
Dim parameters As IVariantArray
Set parameters = New varArray
'// create the layer for selection
parameters.Add "taxparcels"
parameters.Add "parcels"
GP.Execute "MakeFeatureLayer_management", parameters, Nothing
parameters.RemoveAll
'// join the parcel updates table using parcel_id field
parameters.Add "parcels"
parameters.Add "parcel_id"
parameters.Add "parcel_updates"
parameters.Add "parcel_id"
GP.Execute "AddJoin_management", parameters, Nothing
parameters.RemoveAll
'// qualify the identically named fields
Dim id As String
Dim update_id As String
id = GP.QualifyFieldName("parcels", "parcel_id")
update_id = GP.QualifyFieldName("parcel_updates", "parcel_id")
Page 27 5/24/2006 Tools
'//select the parcels using the qualified names
parameters.Add "parcels"
parameters.Add "New_Selection"
parameters.Add id & " = " & update_id 'not clear
GP.Execute "SelectLayerByAttribute_management", parameters, Nothing
parameters.RemoveAll
'//calculate the update flag to be true for the selected parcels
parameters.Add "parcels"
parameters.Add "updateflag"
parameters.Add "True"
GP.Execute "CalculateField_management", parameters, Nothing
Dim GP As IGeoProcessor
Set GP = New GeoProcessor
'// Set the input workspace environment
Dim sde As String
sde = "Database Connections/vampire.sde/LegalFabric"
GP.SetEnvironmentValue "workspace", sde
Dim parameters As IVariantArray
Set parameters = New varArray
'// create the layer for selection
parameters.Add "taxparcels"
parameters.Add "parcels"
GP.Execute "MakeFeatureLayer_management", parameters, Nothing
parameters.RemoveAll
'// join the parcel updates table using parcel_id field
parameters.Add "parcels"
parameters.Add "parcel_id"
parameters.Add "parcel_updates"
parameters.Add "parcel_id"
GP.Execute "AddJoin_management", parameters, Nothing
parameters.RemoveAll
'// qualify the identically named fields
Dim id As String
Dim update_id As String
id = GP.QualifyFieldName("parcels", "parcel_id")
update_id = GP.QualifyFieldName("parcel_updates", "parcel_id")
Page 27 5/24/2006 Tools
'//select the parcels using the qualified names
parameters.Add "parcels"
parameters.Add "New_Selection"
parameters.Add id & " = " & update_id 'not clear
GP.Execute "SelectLayerByAttribute_management", parameters, Nothing
parameters.RemoveAll
'//calculate the update flag to be true for the selected parcels
parameters.Add "parcels"
parameters.Add "updateflag"
parameters.Add "True"
GP.Execute "CalculateField_management", parameters, Nothing