I have made a little progress. I used pythonWin to debug the program and finally have more info on why the script is failing at the SelectLayerByAttribute step. The error is as follows:
Traceback (most recent call last):
File "C:\ESRI\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 309, in RunScript
debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File "C:\ESRI\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\debugger\__init__.py", line 60, in run
_GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File "C:\ESRI\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\debugger\debugger.py", line 624, in run
exec cmd in globals, locals
File "Y:\John_N\From_desktop\python_training_scripts\dist_map_test1.py", line 22, in <module>
arcpy.SelectLayerByAttribute_management (r"Y:\John_N\Wetland_field_guide_distribution_maps\counties_datamergetest_export2.lyr", "NEW_SELECTION", '"' + str(field) + '" ' > 0)
File "C:\ESRI\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 4259, in SelectLayerByAttribute
raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000825: The value is not a layer or table view
ERROR 000840: The value is not a Raster Layer.
ERROR 000840: The value is not a Mosaic Layer.
Failed to execute (SelectLayerByAttribute).
I saved the shapefile I was using as a layer file and tried to use that path but receive the same error. Am I missing something or incorrectly saving as a layer file?