laptop and a wrench

Error

AddJoin gives error when joining a SqlServer table with no ObjectID.

Última publicación: August 25, 2014 ArcGIS for Desktop
Número de ID del error NIM039018
EnviadoOctober 3, 2008
Última modificaciónJune 5, 2024
Relacionado conArcGIS for Desktop
Versión encontrada9.3
Sistema operativoWindows OS
Versión de sistema operativoXP
EstadoDuplicate

Información adicional

Duplicate of NIM038601

Solución alternativa

Use ArcObjects code IMemoryRelationshipClassFactory & IDisplayRelationshipClassSee sample below.Public Sub joinATable() On Error GoTo EH Dim pDoc As IMxDocument Dim pMap As IMap Set pDoc = ThisDocument Set pMap = pDoc.FocusMap ' Get the first layer in the table on contents Dim pFeatLayer As IFeatureLayer Dim pDispTable As IDisplayTable Dim pFCLayer As IFeatureClass Dim pTLayer As ITable If pMap.LayerCount = 0 Then MsgBox "Must have at least one layer" Exit Sub End If Set pFeatLayer = pMap.Layer(0) Set pDispTable = pFeatLayer Set pFCLayer = pDispTable.DisplayTable Set pTLayer = pFCLayer ' Get the first table in the table on contents Dim pTabCollection As IStandaloneTableCollection Dim pStTable As IStandaloneTable Dim pDispTable2 As IDisplayTable Dim pTTable As ITable Set pTabCollection = pMap If pTabCollection.StandaloneTableCount = 0 Then MsgBox "Must have atleast one table" Exit Sub End If Set pStTable = pTabCollection.StandaloneTable(0) Set pDispTable2 = pStTable Set pTTable = pDispTable2.DisplayTable ' Create virtual relate Dim pMemRelFact As IMemoryRelationshipClassFactory Dim pRelClass As IRelationshipClass Set pMemRelFact = New MemoryRelationshipClassFactoryDim strJoiningFieldinTable As StringDim strJoiningFIeldinFeatureClass As StringstrJoiningFieldinTable = "inty"strJoiningFIeldinFeatureClass = "Fid" Set pRelClass = pMemRelFact.Open("TabletoLayer", pTTable, strJoiningFieldinTable, pTLayer, _ strJoiningFIeldinFeatureClass, "forward", "backward", esriRelCardinalityOneToOne) ' use Relate to perform a join Dim pDispRC As IDisplayRelationshipClass Set pDispRC = pFeatLayer pDispRC.DisplayRelationshipClass pRelClass, esriLeftOuterJoin MsgBox ("done") Exit SubEH: MsgBox Err.Number & " " & Err.Description End Sub

Pasos para reproducir

ID del error: NIM039018

Software:

  • ArcGIS for Desktop

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga