Layer.workspacePath returns wrong value

Discussion created by jvseagle-co-nz-esridist Employee on Feb 8, 2013
Latest reply on Feb 11, 2013 by jvseagle-co-nz-esridist

I am using ArcGIS for Desktop 10.1 SP1

I have created a database connection with name Test1 and stored in a directory as follows:

I right clicked the connection file in ArcCatalog --> General Tab --> Looked into the property name and noticed that it says C:\Temp\Test1.sde which is fine.

If I copy with ArcCatalog/Catalog Window the connection and place it in some other location I can confirm that these values are updated.

However, whenever you copy this using Windows Explorer these values don't change, probably as expected.

I have noticed though, that when you get the property layer.workspacePath that this value seems to be returning the property name instead of the actual location (fullname) where the file is now placed.

This is problematic because I am determining at runtime which are the different sources in the map looping through each layer and this creates an issue. Is there a workaround for this?

Thanks in advance,