AnsweredAssumed Answered

Create file GDB, importing tables results in empty list when using arcpy.ListTables()

Question asked by richan01 on Jul 31, 2012
Latest reply on Aug 3, 2012 by richan01
I'm creating a file GDB and then importing tables (Excel) with TableToGeodatabase. After that I want to list them using arcpy.ListTables but it results in an empty list, even though they are there when I check in ArcCatalouge. In ArcCatalouge I can copy the tables for example but in the Python window I can't list them or access them (like they don't exist).

However, if I create a file geodatabase in ArcCatalouge and then import the tables using right click > import (table, multiple) the tables will show up in Python using arcpy.ListTables()

import arcpy  # Get parameters to create geodatabase OutputFolder = arcpy.GetParameterAsText(0) FGDName = arcpy.GetParameterAsText(1)  # Create File GDB... OutputGDB = OutputFolder + '\\' + FGDName + '.gdb' arcpy.management.CreateFileGDB(OutputFolder, FGDName)  # Set current workspace to to file geodatabase arcpy.env.workspace = OutputFolder  # Get parameters to import tables to geodatabase adress = arcpy.GetParameterAsText(2) adress_xy = arcpy.GetParameterAsText(3)  # Import tables to geodatabase arcpy.conversion.TableToGeodatabase([adress, adress_xy], OutputGDB)


Any help would be greatly appreciated-
Thanks
/ Rickard

Outcomes