AnsweredAssumed Answered

SetValue error

Question asked by Rock_Doc on Oct 14, 2019
Latest reply on Oct 14, 2019 by Rock_Doc

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")

Outcomes