Points are not selected or highlighted after using SelectLayerByAttribute_management

711
0
04-26-2013 01:17 PM
dancheng
New Contributor II
Hi there,

So I have one feature class in a personal geodatabase. I wrote a python script using "selectLayerByAttribute_management", the script was running successfully however the selected records are not highlighted in arcmap. I ran the script in both standalone version and by adding it as a script in ArcToolbox. thanks in advance! Here is my code:

import arcpy

arcpy.env.workspace = "C:/Users/dcheng/Documents/IDOP test/tables/IDOP_test.mdb"

hole_shp = "holes_leg1_leg96_fortest"
hole_shp_lyr = "holes_leg1_leg96_lyr"
arcpy.MakeFeatureLayer_management(hole_shp, hole_shp_lyr)
arcpy.SelectLayerByAttribute_management(hole_shp_lyr, "NEW_SELECTION", '[PK] = "1_5A"')

print "done"


Thanksss!
Dan
0 Kudos
0 Replies