ArcGIS中可以将整个数据库库结构输出成XML文件,单一的表的表结构没有单独导出成XML文件,而是需要把表结构和数据一起导出成XML文件。在ArcGIS Engine同样都可以有相应的接口来实现。 | |||||
过程描述 | |||||
在Engine中使用IGdbXmlExport和IGDBXmlImport接口来实现。下面是导出整个库结构的例子代码: Private Sub ExportWS_Schema(db As String, XmlFile As String) Dim pWSF As IWorkspaceFactory Set pWSF = New AccessWorkspaceFactory '*** 打开*** Dim pWS As IWorkspace Set pWS = pWSF.OpenFromFile(App.Path + db, 0) Dim pExporter As IGdbXmlExport Set pExporter = New GdbExporter pExporter.ExportWorkspaceSchema pWS, XmlFile, False, True End Sub Private Sub cmdExportWS_Schema_Click() Me.MousePointer = vbHourglass '*** PGDB 的位置 *** Dim db As String db = "GN.mdb" '*** xml的位置 *** Dim XmlFile As String XmlFile = App.Path + "GN.xml" ExportWS_Schema db, XmlFile MsgBox "Exported Geodatabase Workspace Schema to XML.", vbInformation End Sub |