Is This Content Helpful?
We're glad to know this article was helpful.
When adding a new record to an address table that has a related geocoded feature class, this error occurs:
“Could not insert new record."
If the address table is dynamically related to a geocoded feature class, the GeocodedFeatureClassExtension feature class extension on the geocoded feature class attempts to geocode the address contained in the record that was added to the address table. If this error occurs, the reference data for the geocoding service that was used to create the geocoded feature class is unavailable.
You can modify the GeocodedFeatureClassExtension object so it does not attempt to geocode new records that you add to the address table. Use the following steps to modify the GeocodedFeatureClassExtension on the geocoded feature class:
Public Sub DisableAutomaticGeocoding(pFeatureClass As IFeatureClass)
Const GUID_NAME_GEOCODEDFEATURECLASSEXTENSION = _
Dim pClassSchemaEdit As IClassSchemaEdit
Dim pPropertySet As IPropertySet
Dim pSchemaLock As ISchemaLock
Dim pUID As New UID
' +++ Get an exclusive lock on the FeatureClass
Set pSchemaLock = pFeatureClass
' +++ Alter the FeatureClassExtension on the geocoded FeatureClass
pUID.Value = GUID_NAME_GEOCODEDFEATURECLASSEXTENSION
Set pPropertySet = New PropertySet
.SetProperty "OriginalAddressFieldNames", "Address"
' +++ The UpdateOnEdit property indicates if Features in the
' +++ FeatureClass are updated if the corresponding Rows in the
' +++ Table are edited
.SetProperty "UpdateOnEdit", True
' +++ The UnmatchOnly property whether the
' +++ GeocodedFeatureClassExtension should attempt to geocode
' +++ inserted or edited Features or to add them to the
' +++ FeatureClass with a status of Unmatched
.SetProperty "UnmatchOnly", True
Set pClassSchemaEdit = pSchemaLock
pClassSchemaEdit.AlterClassExtensionCLSID pUID, pPropertySet
' +++ Reset the schema lock on the FeatureClass