Take the 2-minute tour ×

I am new to Python and to this community as well, hope someone could help me. I am running script to extract and merge toghether the tables of some Raster. Each Attribute Table presents only one row and the same field names. My script works fine until the very end of it, when I try to merge all the tables. It seems the tables are locked (I can see an "sr.lock" file for each Table I want to merge in my folder (that desappear only when arcgis programs are closed) and I cannot access them. Strange thing: I do access them if I simply use a sample (for instance) of two of these so created tables in the Python window within arcMap and type their names instead of using a FOR LOOPING... Here is my script: #import relevant modules, create geoprocessing dispatch object import win32com.client, sys, string, os, arcpy

gp = win32com.client.Dispatch("esriGeoprocessing.gpDispatch.1")

# Remember to change this to wherever your files are stored

    rasters = gp.ListRasters("*", "all")
    rst = rasters.Next()

    while rst:
        # Create the new field

        # Apply the filename to all entries       
        rst = rasters.Next()

    print gp.GetMessages ()

listRaster = arcpy.ListRasters ()

for raster in listRaster:

listTable = arcpy.ListTables ()

for table in listTable:
    arcpy.Merge_management (table, 'Cl_Rio_Aconcagua.dbf')

The code is taken from others, I simply adapted it for my needs. Anyway, the error I am receiving so far doesn't have to do explicitly with LOCK topics, but since I have those files in my folder the problem might be due to that. Even if I don't use the FOR LOOP (which seems not necessary), I always receive this error:

ERROR 000732: Input Datasets: Dataset 'xxx;xxx...' does not exist or is not supported
Failed to execute (Merge)
share|improve this question

closed as not constructive by PolyGeo, Simon, R.K., whuber Jan 6 '13 at 17:09


YOu might want to answer your own question and accept that answer. That way other people can learn from your experience. –  R.K. Sep 26 '12 at 7:16
Question has been answered as Comment which has not been moved to Answer after 4 months => Close vote from me –  PolyGeo Jan 5 '13 at 21:53

Browse other questions tagged or ask your own question.