Hi all
Having some issues trying to debug someone else's code in Desktop 10.3, and we've traced the issue back to a SetValue call in the script. Adding in our own messages at various points, it seems to make the new row without any issues, but has a problem with SetValue. Outputting the values of fldID and ID to the screen shows that those values are correct at the time of the function call, but using SetValue fails.
Any ideas? Appreciate any help!
try:
VTabNNC = arcpy.InsertCursor(vTabNNPath)except:
raise arcpy.ExecuteError("InsertCursor error")while fRBNDX:
#gp.AddMessage(vTabNNPath)
if len(strLn01) != 0:
if len(strLn01.split(",")) < 3:
strLn01 = ""
try:
#gp.AddMessage(vTabNNPath)
#gp.AddMessage("Creating new row...")
r = VTabNNC.newRow() #THIS WORKS
#gp.AddMessage(ID)
r.SetValue(fldID,ID) #THIS FAILS
#gp.AddMessage(ID)
VTabNNC.insertRow(r)
except:
raise arcpy.ExecuteError("Error creating new row")
Solved! Go to Solution.
in new arcpy for pro it is row.setValue in lower case 's'
in new arcpy for pro it is row.setValue in lower case 's'
I am still on Desktop 10.3 though...
Anyway, it fixed it! Many thanks
not a lot would change along those lines... and make sure you are using the data access cursors to carry you forward when you move to Pro
Yes, noticed that when I was searching the community for an answer. Once we've got it working in 10.3, next step is to migrate it to Pro.