laptop and a wrench

Erro

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

Última Publicação: August 25, 2014 ArcGIS for Desktop
Número de ID do Erro NIM039018
EnviadoOctober 3, 2008
Última ModificaçãoJune 5, 2024
Aplica-se àArcGIS for Desktop
Versão encontrada9.3
Sistema OperacionalWindows OS
Versão do Sistema OperacionalXP
StatusDuplicate

Informações Adicionais

Duplicate of NIM038601

Solução Provisória

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

Etapas para Reproduzir

ID do Erro: NIM039018

Software:

  • ArcGIS for Desktop

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download