I am trying to update a date field if it is NULL. Everything works but updateRow
I am typing it because the code is not on this network
import arcpy
from arcpy import env
env.workspace = "d:/IdeProjects"
mypath = "d:/Ideprojects/Defworkspace/DefGDB.mdb"
gdb_tobe_moded = mypath +"/fdmag"
cur = arcpy.UpdateCursor(gdb_tobe_moded)
fields = arcpy.ListFields(gdb_tobe_moded)
for row in cur:
for field in fields:
if field.name == "REPORT_DATE":
# Save the current report date
svrpt = row.getValue(field.name)
if field.name == "INCIDENT_DT":
if row.getValue(field.name) == None:
print "value stays"
else:
row.setValue(field.name,svrpt)
cur.updateRow(row)
del row
del cur
If I comment out the updateRow it works but nothing is changed. If I leave it in it blows.
With
Traceback ...
File ID myfile
cur.updateRow(row)
File ...*** arcobbjects.py
in line 102, in updateRow
return convertArcObjectToPythonObject(self._arc_object.UpdateRow(*gp_fixargs(args)))
RuntimeError: ERROR 999999: Error executing Function
Cannot open database ' '. It may be a database that you application recognizes, or it may be corrupt
Any Help?