Select to view content in your preferred language

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

2634
3
01-28-2013 04:00 AM
SvendMidtgaard
New Contributor
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)
Tags (2)
0 Kudos
3 Replies
by Anonymous User
Not applicable
Have you downloaded the 64-bit background geoprocessing?  If you have, when you run a Python script it probably will default to the 64 bit python since that would be the latest version installed.  The 64 bit will not work with personal geodatabases.  You can force the python version to go use 32 bit for scripts that use personal gdb's by creating a batch file.  You can create a text file with a ".bat" extension.  Something like this:

start C:\Python27\ArcGIS10.1\python.exe G:\Misc\Scripts\UNMPD_PARCELS.py


You can check which version you are using by putting this print line in your scripts:

print "Running against: {}".format(sys.version)


The 32 bit is "C:\Python27\ArcGIS10.1\python.exe".

The 64 bit version is in this folder:

C:\Python27\ArcGISx6410.1\python.exe

That would be my guess as to why it works when you use a file gdb and not personal.  Also, if you are 10.1 you should use arcpy, not arcgisscripting.
0 Kudos
SvendMidtgaard
New Contributor
Hi Caleb1987 - thanks for the answer, you are right: It all works when I explicitly use the 32-bit version of Python.

But I just discovered, that FeatureClassToFeatureClass to a personalgeodatabase with ArcCatalog also fails. No Python is involved, I right-click inside a personal geodatabase and choose "import". I get this errormessage:
Messages
Executing: FeatureClassToFeatureClass C:\A\test2\TestX1.gdb\Linie2 C:\A\test2\TestX2.mdb Linie2 # "SHAPE_Length "SHAPE_Length" false true true 8 Double 0 0 ,First,#,C:\A\test2\TestX1.gdb\Linie2,SHAPE_Length,-1,-1" #
Start Time: Wed Jan 30 08:00:47 2013
ERROR 999999: Error executing function.
Failed to execute (FeatureClassToFeatureClass).
Failed at Wed Jan 30 08:00:48 2013 (Elapsed Time: 1,00 seconds)

Is there a workaround for this problem too?

Has ESRI announced a stop for supporting the .mdb-format with 64-bit?
If so, I will stop using it to avoid problems and workarounds. Some functions seems to work (i.e. create featureclass), while others do not.

Thanks a lot
Svend
0 Kudos
MathewCoyle
Frequent Contributor

Has ESRI announced a stop for supporting the .mdb-format with 64-bit?


I imagine it was just an over sight since they don't encourage people to use personal geodatabases and 64-bit geoprocessing is pretty new. You can try this release from microsoft that helps with compatibility between 32-bit and 64-bit but I can't speak to whether this will have any effect on your problem.
http://www.microsoft.com/en-us/download/details.aspx?id=13255

Edit: And it doesn't seem like Esri has any plans on supporting personal geodatabases in the future.
http://resources.arcgis.com/en/help/main/10.1/index.html#//00vp0000002t001324
0 Kudos