my_backpack

replaceDataSource not working

Discussion created by my_backpack on Jul 20, 2011
Latest reply on Jan 30, 2013 by mvolz47
I'm trying to redirect a raster layer in an mxd from one SDE to another.

the relavent Code:
sdeFile = r"G:\DEPARTMENTS\GIS\Chris_Graff\temp\Aerial.sde"
...
lyr.replaceDataSource(sdeFile, "SDE_WORKSPACE", r"AERIAL.DATALOADER.AP2008", True)

when this runs I don't get any errors.  When I open the mxd it changed the workspace to the correct SDE but the raster's dataset_name is still the old name ("STATIC.DATALOADER.AP2008") rather than the one I provided.

Anyone have any ideas?  I'm running arcgis 10sp2
thanks,
-chris

Outcomes