阅读:1458回复:2
求AO加载SDE中FeatureDataset的方法?
通过SDE连接,可以获取FeatureDataset
ftrDataset = pWorkspace.OpenFeatureDataset("SDE.FZ_DLG") 请问如何将ftrDataset加载到AO中去? |
|
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> |
|
|
2楼#
发布于:2004-07-06 08:46
<P>哎,在下愚笨,看不太明白!</P><P>大虾能讲得稍微清楚一些吗? </P>
|
|