I literally copied and pasted the file path (r'C:\Users\myName\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\mydatabase.sde'), but after I run my script, I always get the error saying error 267, the directory name is invalid.
closed as off-topic by PolyGeo♦ Jul 5 at 21:20
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – PolyGeo
This works for me to access ArcSDE feature classes in feature datasets;
wrkspc = r"D:\Projects\DotNetDataLoader\Connection to xxx.xx.x.xxx.sde" arcpy.env.workspace = wrkspc listds = arcpy.ListDatasets("*"): for ds in listds: listfc = arcpy.ListFeatureClasses("*","",feature_dataset=ds) for fc in listfc: print fc