jroberts

IVersionedTable esriDifferenceTypeUpdateUpdate question

Discussion created by jroberts on Nov 8, 2012
Hi Guys

Hopefully someone out there can answer this.  I have some code (based on ESRI examples) that loops through all the feature classes in a feature dataset and attempts to identify all differences between two versions - conflict or not.  Trouble is, my code appears to find conflicts that aren't found by a standard post and reconcile in ArcMap.  I'm working from the example below.  My application will find conflicts and log them (especially update/update conflicts) - however, if I go right back into ArcMap and do a reconcile and post ArcMap doesn't find anything.  Further, a detailed inspection of the candidate feature shows that there is no difference at all between the versions... 

Confused...  Any ideas?

[Visual Basic 6.0]
'IVersionedTable.Differences example for detecting the number of inserts between a
'version and the DEFAULT version in ArcMap
Dim pDoc As IMxDocument
Set pDoc = ThisDocument

Dim pLayer As ILayer
Set pLayer = pDoc.FocusMap.Layer(0)
 
'Open the two feature classes from the two versions that we are going to compare
Dim pFeatureLayer As IFeatureLayer
Dim pData As IFeatureDataset
Dim pWorkspace As IWorkspace
Dim pVerWorkspace As IVersionedWorkspace
Dim pVersion1 As IVersion, pVersion2 As IVersion
Dim pFeatWork1 As IFeatureWorkspace, pFeatWork2 As IFeatureWorkspace
Dim pTable1 As ITable, pTable2 As ITable, pVerTable2 As IVersionedTable

Set pFeatureLayer = pLayer
Set pData = pFeatureLayer.FeatureClass.FeatureDataset
Set pWorkspace = pData.Workspace
Set pVerWorkspace = pWorkspace
Set pVersion1 = pVerWorkspace
Set pVersion2 = pVerWork.FindVersion("SDE.DEFAULT")
Set pFeatWork1 = pVersion1
Set pFeatWork2 = pVersion2
Set pTable1 = pFeatWork1.OpenFeatureClass("Sewer_mains")
Set pTable2 = pFeatWork2.OpenFeatureClass("Sewer_mains")
Set pVerTable2 = pTable2

Dim pDiffCursor As IDifferenceCursor
Dim pDiffRow As IRow
Dim lOID As Long
Dim count As Integer
count = 0

'Detect the insert differences between the current version and the DEFAULT version
Set pDiffCursor = pVerTable2.Differences(pTable1, esriDifferenceTypeInsert, Nothing)
pDiffCursor.Next lOID, pDiffRow

If lOID > -1 Then
   Do Until pDiffRow Is Nothing
     count = count + 1
     pDiffCursor.Next lOID, pDiffRow
   Loop
   MsgBox count & " Inserts detected."
Else
   MsgBox "No Inserts detected."
End If

Outcomes