arcpy SDE layer file data source issue

Discussion created by ryankelley001 on Oct 5, 2011
Latest reply on Oct 8, 2011 by jbarrette-esristaff
(also posted in map automation)

To simply state my problem...

I have two layers in my TOC. They both have the same SDE data source. However, one was added as a layer file. The issue is that I am trying to get the spatial reference for any layer in the TOC and when I get to the layer added as a layer file, I get a runtime error when I try to describe the spatial reference.

for lyr in lyrList:
    print lyr.name
    print lyr.dataSource
    desc = arcpy.Describe(lyr.dataSource)
    print desc.spatialReference.name

In line 3 above, my dataSource for the layer file points to the "C:\Documents and Settings\...\bnd", while the non-layer file points to "Database Connections\me@1.sde\bnd"

My error is in line 4 on the layer file: "Runtime error <type 'exceptions.IOError'>: C:\Documents and Settings\bhaney\Application Data\ESRI\ArcCatalog\orwa_sde@orsovctr.sde\OSODBA.Plan_Area_Boundary\OSODBA.PLANBDY_POLY does not exist"

Is this a configuration issue? Is this a known issue?

thank you,