[Visual Basic 6.0]'*** The following example allows you to export the workspace from a pgdb to an xml file. ***
'*** This requires an ArcGIS License and you will need to initialize the AoInitialize CoClass ***
Private Sub ExportWS_Schema(db As String, XmlFile As String)
Dim pWSF As IWorkspaceFactory
Set pWSF = New AccessWorkspaceFactory
'*** Open PGDB ***
Dim pWS As IWorkspace
Set pWS = pWSF.OpenFromFile(App.Path + db, 0)
'*** Create Exporter ***
Dim pExporter As IGdbXmlExport
Set pExporter = New GdbExporter
'*** Export WS schema to XML in Normalized format and not compressed ***
pExporter.ExportWorkspaceSchema pWS, XmlFile, False, True
End Sub'*** Create a commandbutton and copy/paste following code. ***Private Sub cmdExportWS_Schema_Click()
Me.MousePointer = vbHourglass
'*** Location of PGDB ***
Dim db As String
db = "\GN.mdb"'*** Location of xml file ***
Dim XmlFile As String
XmlFile = App.Path + "\GN.xml"
ExportWS_Schema db, XmlFileMsgBox "Exported Geodatabase Workspace Schema to XML.", vbInformation
End Sub
[Visual Basic .NET, C#, C++]
No example is available for Visual Basic .NET, C#, or C++. To view a Visual Basic 6.0 example, click the Language Filter button
in the upper-left corner of the page.