wanoneone
路人甲
路人甲
  • 注册日期2004-01-15
  • 发帖数20
  • QQ
  • 铜币166枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1458回复:2

求AO加载SDE中FeatureDataset的方法?

楼主#
更多 发布于:2004-07-05 15:34
通过SDE连接,可以获取FeatureDataset
ftrDataset = pWorkspace.OpenFeatureDataset("SDE.FZ_DLG")
请问如何将ftrDataset加载到AO中去?
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2004-07-05 16:53
<P>应该看看帮助就有</P><P>'Create a workspace factory for an <FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>sde</FONT> workspace
 Dim pFact As IWorkspaceFactory
 Set pFact = New SdeWorkspaceFactory
    
 'Open the connection information to connect to an <FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>sde</FONT> server
 Dim pWorkspace As IWorkspace
 Set pWorkspace = pFact.OpenFromFile("d:\MyConnections\sdeserver_vtest.<FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>sde</FONT>", 0)
    
 'QI for the feature workspace of the previous <FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>sde</FONT> connection.
 Dim pFeatws As IFeatureWorkspace
 Set pFeatws = pWorkspace
    
 'QI for the Feature Dataset of that feature workspace
 Dim pFeatds As IFeatureDataset
 Set pFeatds = pFeatws.OpenFeatureDataset("vtest.utilities")
    
 'Now QI for the FeatureClassContainer of that dataset
 Dim pFeatclscont As IFeatureClassContainer
 Set pFeatclscont = pFeatds
    
 'Get an interface to the poles feature class
 Dim pFeatcls As IFeatureClass
 Set pFeatcls = pFeatclscont.ClassByName("vtest.poles")
  
 'Now get the Validation interface of that feature class
 Dim pValidation As IValidation
 Set pValidation = pFeatcls
 
 'Get the enumeration of all the rules for that feature class
 Dim pEnumRule As IEnumRule
 Set pEnumRule = pValidation.RulesBySubtypeCode(200)
 
 'Get the first rule of this enumeration
 Dim pRule As IRule
 Set pRule = pEnumRule.Next
 
 'If there are rules then <FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff>add</FONT> the properties to the list box list1.
 While Not pRule Is Nothing
    If TypeOf pRule Is IAttributeRule Then
      
       frmForm1.lstList1.AddItem pRule.Category
       frmForm1.lstList1.AddItem pRule.Helpstring
       frmForm1.lstList1.AddItem pRule.ID
       frmForm1.lstList1.AddItem pRule.Type
    
    End If
 Wend
</P>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
wanoneone
路人甲
路人甲
  • 注册日期2004-01-15
  • 发帖数20
  • QQ
  • 铜币166枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2004-07-06 08:46
<P>哎,在下愚笨,看不太明白!</P><P>大虾能讲得稍微清楚一些吗? </P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部