stella_gis
路人甲
路人甲
  • 注册日期2004-06-27
  • 发帖数6
  • QQ
  • 铜币146枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:929回复:0

帮我看一下代码,谢谢

楼主#
更多 发布于:2004-06-29 16:25
请问,我用了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
喜欢0 评分0
游客

返回顶部