laptop and a wrench

Bug

Cannot use an existing ArcSDE feature class' fields collection when creating a scratch feature class in personal geodatabase.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM000180
SubmittedOctober 28, 2005
Last ModifiedJune 5, 2024
Applies toNo Product Found
Version found9.1
StatusWill Not Be Addressed

Additional Information

No Public Explanation

Workaround

Copy the fields collection into a new fields collection. See the code below. Alternatively, create the fields collection from scratch. This is better as it will account for fully qualified field names like sde.username.fieldname.Private Sub MakeScratchCopyb1() Dim pMxDoc As IMxDocument Dim pMap As IMap Dim pFlayer As IFeatureLayer Dim pFC As IFeatureClass ' creates a scratch featureclass Set pMxDoc = Application.Document Set pMap = pMxDoc.FocusMap Set pMxDoc = Application.Document Dim pInFC As IFeatureClass Set pFlayer = pMxDoc.SelectedLayer Set pInFC = pFlayer.FeatureClass 'set up the scratch work area Dim pSWSF As IScratchWorkspaceFactory Set pSWSF = New ScratchWorkspaceFactory Dim pFWS As IFeatureWorkspace Set pFWS = pSWSF.DefaultScratchWorkspace Dim pFields As IFields Dim i As Integer Set pFields = New Fields Dim pField As IField Dim pFieldsEdit As IFieldsEdit Set pFieldsEdit = pFields For i = 0 To pInFC.Fields.FieldCount - 1 Set pField = pInFC.Fields.Field(i) pFieldsEdit.AddField pField Next i 'create our new scratch featureclass based on our input featureclass Dim pScratchFC As IFeatureClass Set pScratchFC = pFWS.CreateFeatureClass("QuarterQuarter", pFields, Nothing, Nothing, esriFTSimple, "SHAPE", "") End Sub

Steps to Reproduce

Bug ID: NIM000180

Software:

  • No Product Found

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options