Hi,
I want to write a small tool, which insert some data into an MS-Access database (.mdb). But i have a problem to initialize the cursor.
The Code is very simple :
strOutputPath = r"I:\Data\Test.mdb\FS_BASEMAP\FCL_B_COVERSHEET_A"
icur = arcpy.InsertCursor(strOutputPath)
There is some more code but it stoped at this point and I get this error message:
Traceback (most recent call last):
File "I:\Skript\AddFeatureSkript.py", line 70, in <module>
icur = arcpy.InsertCursor(strOutputPath)
File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\__init__.py", line 1214, in InsertCursor
return gp.insertCursor(dataset, spatial_reference)
File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 369, in insertCursor
self._gp.InsertCursor(*gp_fixargs(args, True)))
RuntimeError: ERROR 999999: Fehler beim Ausführen der Funktion.
COM-Komponente der Objektklassenerweiterung konnte nicht erstellt werden. [FCL_B_COVERSHEET_A]
The error message is in german so I translate it:
ERROR 999999: Error when executing the function.
COM component object class extension could not be created. [FCL_B_COVERSHEET_A]
I don't know what the problem is, so hopefully some can help me.
Thanks, Regards
Hi Christof,
I believe you are running your script with Python 64-bit, which no longer supports personal geodatabases (.mdb). You will want to run the script with Python 32-bit. Take a look at the section 'Python scripting' in the following link:
Hey Jake,
thanks for your answer, but I have only a 32 bit version of python installed on my computer and even the ArcGIS is 32 bit.
I just looked it up.
*push*
As a test, can you copy the data to a File Geodatabase and see if you receive the error?
So I tried it with a .gdb and used arcpy.da.InsertCursor and I works. I get no error message there, but unsing a .gdb isn't an option because the provided data is in the .mdb format.
What is the error message if you use arcpy.da.InsertCursor instead of arcpy.InsertCursor? Do you have a requirement to use the older InsertCursor? Besides better performance, the data access InsertCursor supports Python's with statement, which I find to be a big plus.
If I use arcpy.da.InsertCursor. I get this error message:
Traceback (most recent call last):
File "I:\Skripte\\AddFeatureSkriptv.py", line 70, in <module>
icur = arcpy.da.InsertCursor(strOutputPath, ["SHAPE@"])
RuntimeError: cannot open 'I:\Test.mdb\FDS_BASEMAP\FCL_B_COVERSHEET_A'
A few things come to mind.
Sry I was on vacation the last 2 weeks.
1. The I drive is a network drive but I also tried it with the local drive and I get the same error message.
2. I creaded a new MDB but even this dosen't work.
3. Yes I can make a OLE DB connection to the MDB.