阅读:929回复:0
帮我看一下代码,谢谢
请问,我用了itablesort接口,查出来的数据有重复,怎么才能让它唯一。代码如下:
Dim pFeatureClass As IFeatureClass 'Set pLayer = Main.g_pStateLayer Set pFeatureClass = pLayer.FeatureClass ' (2) Sort State layer's table Dim pTableSort As ITableSort Set pTableSort = New TableSort pTableSort.Fields = "cm" pTableSort.Ascending("cm") = True Set pTableSort.Table = pFeatureClass pTableSort.Sort Nothing ' ' (3) Populate the State's combo box Dim pCursor As ICursor Dim pRow As IRow Dim lngFieldIndex As Long Set pCursor = pTableSort.Rows 'Set pCursor = pTableSort.SortCharacters lngFieldIndex = pFeatureClass.FindField("cm") Set pRow = pCursor.NextRow Do While Not pRow Is Nothing cm.AddItem pRow.Value(lngFieldIndex) Set pRow = pCursor.NextRow Loop |
|