JoinTabletoLayere returning different table names in 10.1

Discussion created by rudy411 on Apr 9, 2013
Latest reply on Apr 10, 2013 by rudy411
After the following code is run the attribute table on the shape file to which a comma delimited text file was joined contains the field names as listed on the first line of the text file. In the exported shape file of the joined feature class and table, the field names from the joined text file now appear as qryResults,qryResul_1, qryResul_2, qryResul_3, qryResul_4 instead of the field names in the table of ACTNUM, MA_,SA_,NH_, and PIN. This worked fine in 10.0 and now in 10.1 the next function following the export that uses the field names fails. Is this the result that should be expected from this join in 101?


Dim bolJoin As Boolean
        bolJoin = JoinTableToLayer(pGFLayer, pRTable, "PIN", "PIN")

        pFClass = pGFLayer.DisplayFeatureClass

        exportFC(pFClass, "taxlots_2")

        'pFLayer = New FeatureLayer
        'pFClass = pFWorkspace.OpenFeatureClass("taxlots_2")
        'pFLayer.FeatureClass = pFClass
        'pFLayer.Name = "taxlots_2"


    End Sub
    Public Function JoinTableToLayer(ByVal pFeatureLayer As IGeoFeatureLayer, _
                                     ByVal pTable As ITable, _
                                     ByVal sLayerField As String, _
                                     ByVal sTableField As String) As Boolean
        Dim pMemoryRelationshipClassFactory As IMemoryRelationshipClassFactory
        Dim pRelationshipClass As IRelationshipClass
        Dim pDisplayRelationshipClass As IDisplayRelationshipClass

        'On Error GoTo ErrorHandler

        'pMemoryRelationshipClassFactory = New MemoryRelationshipClassFactory

        pMemoryRelationshipClassFactory = New MemoryRelationshipClassFactoryClass()
        pRelationshipClass = pMemoryRelationshipClassFactory.Open("Join", pFeatureLayer.DisplayFeatureClass, sLayerField, pTable, sTableField, "forward", "backward", esriRelCardinality.esriRelCardinalityOneToOne)
        pDisplayRelationshipClass = pFeatureLayer
        On Error GoTo ErrorHandler
        pDisplayRelationshipClass.DisplayRelationshipClass(pRelationshipClass, esriJoinType.esriLeftOuterJoin)

        JoinTableToLayer = True
        Exit Function
        'ErrorMessage "modGlobals:JoinTableToLayer()"
    End Function