Listing datasets doesn't bring back the correct result

1838
1
09-30-2013 05:23 AM
SimonEarnshaw
New Contributor III
If I do a ListDatasets() in python, then I don't get the correct result in the list except for datasets belong to other schema owners, so why can I still see the datasets in ArcCatalog.

The code is staightforward:

workspace = r'Database Connections\\enidb.sde'
arcpy.env.workspace = workspace
dslist = arcpy.ListDatasets()


The dslist is empty bar the CULTURAL.ESRI_DATASETS - I should be able to see all the ENIDB ones as I am logged in as that schema owner:

[ATTACH=CONFIG]27872[/ATTACH][ATTACH=CONFIG]27873[/ATTACH]
0 Kudos
1 Reply
by Anonymous User
Not applicable
Original User: earnshaw

I found out the problem just use :


arcpy.ClearWorkspaceCache_management()

and this clears any locks.
0 Kudos