import arcpy
fc = "D:/St_Johns/data.mdb/roads"
# Create a search cursor using an SQL expression
#
rows = arcpy.SearchCursor(fc, "[roadclass] = 2")
for row in rows:
# Print the name of the residential road
#
print row.name
import arcpy
fc = "D:/St_Johns/data.mdb/roads"
fieldname = "roadclass"
# Create field name with the proper delimiters
#
delimitedfield = arcpy.AddFieldDelimiters(fc, fieldname)
# Create a search cursor using an SQL expression
#
rows = arcpy.SearchCursor(fc, delimitedfield + " = 2")
for row in rows:
# Print the name of the residential road
print row.name