svendmidtgaard

Append_management fails, when run with Python on personal GeoDB outside ArcGIS

Discussion created by svendmidtgaard on Jan 28, 2013
Latest reply on Jan 30, 2013 by mzcoyle
Append_management and GetCount_management fails, when run with Python on personal GeoDB outside ArcGIS.

When I run the script below from a toolbox in ArcCatalog, it works fine. But when I run it from IDLE or from a commandline it fails with this errormessage: "ERROR 000732: Input Rows: Dataset Data1.mdb\TestFC does not exist or is not supported"

But if I use file geodatabases (.gdb) instead, it works both inside and outside ArcCatalog. It does not matter, whether I use arcgisscripting og arcpy - if I use personal geodatabases it fails outside of ArcCatalog, but works inside.

I use ArcGIS10.1.

Does anybody have a solution or work-around?

Thanks for answering - in advance.

Svend

import os, time
import arcgisscripting
gp = arcgisscripting.create()

SourceFC = "Data1.mdb\\TestFC"
TargetFC = "Data0.mdb\\TestFC"
#SourceFC = "Data1.gdb\\TestFC"
#TargetFC = "Data0.gdb\\TestFC"

NumRecSource = gp.GetCount_management(SourceFC)
Text = "SourceFC = %s: %i records" %(SourceFC, NumRecSource)
gp.AddMessage(Text)
print(Text)

NumRecTarget = gp.GetCount_management(TargetFC)
Text = "TargetFC = %s: %i records" %(TargetFC, NumRecTarget)
gp.AddMessage(Text)
print(Text)

gp.Append_management(SourceFC, TargetFC, "NO_TEST")

NumRecTarget = gp.GetCount_management(TargetFC)
Text = "TargetFC = %s: %i records" %(TargetFC, NumRecTarget)
gp.AddMessage(Text)
print(Text)

Outcomes