Python - insert records to MS Access - error

449
3
04-05-2018 01:05 PM
RobertMEIER
New Contributor III

I'm trying to use Python arcpy to append records to an MS Access table, from a feature class. I keep running into the error:

RuntimeError: ERROR 999999: Error executing function.
You cannot add or change a record because a related record is required in table 'Valid_Locations'

Where 'Valid_Locations' is a related LookUp table. I understand the relationship/referential integrity, etc. I am not inserting a value that is not in the lookup table.

So any ideas?

I get this error whether I use the Append tool/command and field mappings,etc. or using an InsertCursor.

0 Kudos
3 Replies
DanPatterson_Retired
MVP Esteemed Contributor

arcmap or pro?

0 Kudos
RobertMEIER
New Contributor III

ArcMap - Python 2.7

0 Kudos
RobertMEIER
New Contributor III

sorry for the post - my insert cursor code was wrong, I was trying to insert the row before setting all the values. Once I fixed that, I was able to add the rows without error.

Still don't know why the Append tool won't work.