I can't help you with v10, but if it ain't working there (in v10) it sounds like a bug. You should report it to esri. On a side: Pretty quickly I figuered out that due to a variety of bugs, v10 was not stable/compatible for much of my existing v9.3 and v9.2 Python code (this issue being yet another great example), so I guess that's why I haven't moved over there yet. I'll have to eventually though, and it won't be pretty...Excerpt of a v9.3 script that, among other things, gets a shapefield value (searchcursor) and inserts it into a new sorted table (insertcursor) - Works great in v9.3#Process: Now write the sorted records to the new FC
message = "Sorting fields..."; showPyMessage()
searchRows = gp.searchcursor(inputLayer, "", "", "", fieldSortString[:-1])
searchRow = searchRows.next()
message = "Writing sorted records! Please wait..."; showPyMessage()
insertRows = gp.insertcursor(outputLayer)
recordCount = 0
inputLayerOidFieldName = dsc.oidfieldname
origOidPopulateSuccessFlag = True
while searchRow:
#Process: Every 1000 rows give a message about the progress of the cursors
recordCount = recordCount + 1
if divmod(recordCount,1000)[1] == 0:
message = "Writing row = " + str(i) + "..."; showPyMessage()
#Now read the old table and populate the new one
insertRow = insertRows.newrow()
for fieldName in inputLayerFieldList:
try: #you can't write the OID, length, area, etc. fields
if outShpDbfFlag == False:
insertRow.setvalue(fieldName, searchRow.getvalue(fieldName))
if originalOidFieldName not in ["","#"," "]:
try:
insertRow.setvalue(originalOidFieldName, searchRow.getvalue(inputLayerOidFieldName))
except:
origOidPopulateSuccessFlag = False
pass
else:
insertRow.setvalue(fieldName[0:10], searchRow.getvalue(fieldName))
if originalOidFieldName not in ["","#"," "]:
try:
insertRow.setvalue(originalOidFieldName[0:10], searchRow.getvalue(inputLayerOidFieldName))
except:
origOidPopulateSuccessFlag = False
pass
except:
pass
insertRows.insertrow(insertRow)
searchRow = searchRows.next()