Changing sde worspace of layers

1832
1
05-28-2010 08:37 AM
by Anonymous User
Not applicable
Original User: Xavier

Hi
We have to manage a single MXd file but several versioned database using arcobjects.
So, using one single Mxd file, is it possible to dynamically, when the mxd is loaded, to change the workspace of each featurelayer ? The workspace would be configurated using the user selected versionned database (this selection is done by a developed user interface) .
regards
0 Kudos
1 Reply
FreddieGibson
Occasional Contributor III

You should be able to change the sources of your layers using logic shown on the following page.

How to change the data source of a layer

http://help.arcgis.com/en/sdk/10.0/vba_desktop/conceptualhelp/index.html#//0001000000m5000000

I would think if you wanted this to all happen when the map document is loaded that you'd want to implement this within an application extension where you'd need to incorporate logic on how to determine which geodatabase version to connect to.

Creating an application extension

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//00010000001v000000