findAndReplaceWorkspacePaths for ArcSDE connections

Discussion created by gsumerlingesriaustralia-com-au-esridist Employee on Jul 27, 2011
Latest reply on Jul 28, 2011 by jbarrette-esristaff

I am using the findAndReplaceWorkspacePaths for ArcSDE databases in mxd's in a series of folders to update the 3 teir connections to Direct connections. The command I am using is:

mxd.findAndReplaceWorkspacePaths(find_workspace_path=r"", replace_workspace_path=r"C:\Temp\arcsde_DIRECT.sde")

This works fine if I want to replace all the connections in the MXD.

I have the situation though where I have multiple people make mods to the mxd's and have the following list of connections strings:
C:\Documents and Settings\Fred\Application Data\ESRI\ArcCatalog\Direct_vector.sde
C:\Documents and Settings\Fred\Application Data\ESRI\ArcCatalog\Direct_raster.sde
C:\Documents and Settings\Johnathon\Application Data\ESRI\ArcCatalog\Direct_vector.sde

Connections 1,3,4 are all the same database while 2 is a different database.

Is there a way I can wildcard search for the direct_vector.sde (1,3,4) connection without Explicitly stating the path? For example:
mxd.findAndReplaceWorkspacePaths(find_workspace_path=r"*\ArcCatalog\Direct_vector.sde", replace_workspace_path=r"C:\Temp\arcsde_DIRECT.sde")

and how can I use the findAndReplaceWorkspacePaths to update the 4th connection?