Thanks! When I use MakeFeatureLayer and include field restrictions, however, it does not recognize any of my fields. In the code below, all of the "print FieldInfo.getFieldName()" lines return the correct fields/names. When I try to access any of these fields within the cursor though, it throws an error: "Row: Field FID does not exist" (or "Row: Field ___ does not exist" - for any of the other fields it should be reading). Any suggestions?
# Imports...
import time
import Functions
import arcpy
import sys
import traceback
from arcpy import env
from arcpy.sa import *
Input = "C:/AF_WorkingFiles/AgHealth_Iowa/Databases/Shapes/NitrateWells_LandCover/Test_10Locs.shp"
arcpy.MakeFeatureLayer_management(Input,"InputLyr","","","FID; Shape; OBJECTID; UnqRecordI; UnqWellLoc; Flg90_500")
# List land-cover rasters...
L1 = ["LC85","LC90","LC92","LC00","LC02","LC06","LC09"]
for item in L1:
# Environments...
env.workspace = "C:/AF_WorkingFiles/AgHealth_Iowa/Databases/TempData.mdb"
env.overwriteOutput = "True"
env.snapRaster = "'C:/AF_WorkingFiles/AgHealth_Iowa/Databases/AHS_SpatialData.mdb/" + item + "'"
env.cellSize = "'C:/AF_WorkingFiles/AgHealth_Iowa/Databases/AHS_SpatialData.mdb/" + item + "'"
env.extent = "'C:/AF_WorkingFiles/AgHealth_Iowa/Databases/AHS_SpatialData.mdb/" + item + "'"
env.maintainSpatialIndex = False
env.scratchWorkspace = "C:/AF_WorkingFiles/AgHealth_Iowa/Databases/Scratch"
LC_Raster = item
# List buffer sizes...
L2 = ["500","1000","2000","10000"]
for item in L2:
# For each raster/buffer combo, do the following:
BuffSize = item
Dist = item + " Meters"
a = 0
cur1 = arcpy.UpdateCursor("InputLyr")
rowCount = arcpy.GetCount_management("InputLyr")
print "Row Count =",rowCount
desc = arcpy.Describe("InputLyr")
FieldInfo = desc.fieldInfo
print "Field Count =",FieldInfo.count
print "Field 1 =",FieldInfo.getFieldName(0)
print "Field 2 =",FieldInfo.getFieldName(1)
print "Field 3 =",FieldInfo.getFieldName(2)
print "Field 4 =",FieldInfo.getFieldName(3)
print "Field 5 =",FieldInfo.getFieldName(4)
print "Field 6 =",FieldInfo.getFieldName(5)
for row in cur1:
a = a+1
print row.FID
del cur1, row