Apr 30

Using python to repair data sources

This is really here for me to remember these.  But two lines of python code can be used to change the data source of your current MXD.  Thanks to Malcolm Lobley of Delo Solutions for this tip.


mxd = arcpy.mapping.MapDocument(“CURRENT”)

mxd.replaceWorkspaces(“”, “”, r’Database Connections\Connection To SDE.sde’, “SDE_WORKSPACE”)



Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>