This content has been marked as final. Show 3 replies
I'm not sure if the problem you are having is with your .replace statement. You are not using the raw (r) format, the back slashes may be causing a problem.
lyr = arcpy.mapping.Layer(r"C:\temp\index.lyr")
Jeff, thanks for the reply. You are correct, I should have used the "raw" format in my example, my fault.1 of 1 people found this helpful
After carefully reading the documentation, I realized that by default the "validate" is set to True. In my case ,the database that I was trying to re-point the layer file did not exist yet. This syntax now works:
lyr.findAndReplaceWorkspacePath("", workPathNew, False)
lyr.findAndReplaceWorkspacePath(workPath, workPathNew, False)
Based on the testing we've done together, it appears your issue is resolved with SP1. Several issues have been addressed that are specific to change SDE data sources.
Thanks for your help,