Store and retrieve Layers in the GeoDatabase



Description:

This sample show how to store FeatureLayers in the GeoDatabase and how to use a GxObject to retrieve them to view in ArcCatalog and ArcMap
Products:
ArcView: VB6

Platforms: Windows

Minimum ArcGIS Release: 9.0

How to use:
  1. Run INSTALL.BAT to register DatabaseLayers.dll and assign objects to their proper component categories
  2. Start ArcMap
  3. Add the command "Save Layer to GeoDatabase" (under the category "Developer Samples") to the map.
  4. Connect to a GeoDatabase. If using SDE, connect as the user SDE.
  5. Add a FeatureClass coming from the GeoDatabase to the map.
  6. Alter the symbology in ArcMap to make it look as you'd like it.
  7. Select the layer in the table of contents
  8. Click on "Save Layer to GeoDatabase" command
  9. The Layer is now saved the the GeoDatabase
  10. To open the Layer from the geodatabase, navigate to the GeoDatabase and go into the folder titled "Database Layers"

Download the VB6 files
DatabaseLayerWorkExt.cls Workspace Extension to hide tables in GeoDatabase
EnumBSTR.cls Helper object used to hide tables in GeoDatabase
GxDatabaseLayer.cls Gx Object implementing IGxLayer
GxDatabaseLayerDBExt.cls GX Database Extension Object
GxDatabaseLayers.cls GX Object implementing IGxObjectContainer
SaveLayerCmd.cls Mx Command for saving Layer to the GeoDatabase
modGlobals.bas Helper module where constants declared
DatabaseLayers.res resource file for the contained object
DatabaseLayers.dll DLL file for the contained object
DatabaseLayers.vbp Project for the contained object dll

Download the files for all languages



Key Libraries: GeoDatabase, Carto
Key CoClasses:FeatureLayer
Key Interfaces: IWorkspaceExtension, IWorkspaceExtensionControl, IGxDatabaseExtension, IGxObject, IGxObjectUI, IGxObjectEdit, IGxObjectContainer, IGxLayer, IMemoryBlobStream, IPersistStream, IFeatureLayer
Key Members:IPersistStream.Load, IFeatureLayer.FeatureClass