Original User: bwraggHi,We have layers stored in File Geodatabase joined to 3 x SQL Server tables of tabular data via an OLE DB connection. We also have 1 x XY Event layer that has its datasource set as one of these SQL Server tables. Recently the SQL Server database got migrated resulting in a hostname change for the SQL Server. As a result all the joins & relates stoppted working. The data held in the SQL Server tables is very changable and very rich in content so we have about 20 joins per mxd! Obviously I needed a quick way to fix these files. Worse yet, IT says that another migration will happen soon as this was just a temporary emergency migration.I've been reading all the threads I can on using findAndReplaceWorkspacePaths and I've succeeded in creating a python script that runs thru a directory of mxds and using the following code to replace a workspace (not quite the code but the basic idea):oldWorkspace=r"C:\path\to\old\connection\OldDB.odc"
newWorkspace=r"C:\path\to\new\connection\NewDB.odc"
mxd = arcpy.mapping.MapDocument(pathtomxdfile)
mxd.findAndReplaceWorkspacePaths(oldWorkspace,newWorkspace,false)
mxd.saveACopy(pathtonewmxdfile\newmxd.mxd,"9.3)
The script runs with no errors and outputs files that I can open in 9.3. When I open them in 9.3 the 3 x tables connection have been fixed, I can open then and see the data in them. Also the 1 x XY Event layer that is built from 1 of these tables is working great. So the workspace replacement code I've created has seemingly worked great.But here is my problem....every single join and relate fails! When I look at what joins and relates are setup on the layers, every layer shows no joins or relates.I noticed that the file takes a while to open which made me think that it may still be trying to connect to the old database. To check this I've opened the mxd file in notepad and I found that when I search thru the file there still occurs numerous references to the old database name. Also I think this occurs exactly the same number of times as the number of joins. So I believe that the code above is not replacing the join data correctly.Any ideas what I'm doing wrong or have I misunderstood the limitations of findAndReplaceWorkspacePaths.thanksbwragg