Description
The workspace environment must be set for the function used. The workspace environment is used by a number of the List functions (including ListDatasets, ListFeatureClasses, ListRasters, ListTables, ListWorkspaces) to define the location from which the list will be built.
Solution
Set the workspace environment to a workspace or feature dataset.