Thanks again for all the help everyone, but I still cannot get this to work even when trying to customize a script that i start in model builder. Here is my code, hopefully this helps.
THANKS!
# Polling_Location.py
# Created on: Wed May 12 2010 10:49:48 AM
# (generated by ArcGIS/ModelBuilder)
# Usage: Polling_Location <User_Address> <Selected_Precinct> <Output_Layer>
# Description:
# Selects the voting precinct by a user address.
# ---------------------------------------------------------------------------
# Import system modules
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
gp.OverwriteOutput = 1
# Load required toolboxes...
gp.AddToolbox("C:/arcgis/ArcTutor/GP Service Examples/SelectingData/SelectionUtilities.tbx")
gp.AddToolbox("C:/Program Files (x86)/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
gp.AddToolbox("C:/Program Files (x86)/ArcGIS/ArcToolbox/Toolboxes/Geocoding Tools.tbx")
# Script arguments...
User_Address = raw_input("Enter Address:")
table = "\\\\coggis01\\gis\\MapServices\\Tasks\\Geoprocessing\\Address.gdb\\Address"
# Call the InsertCursor method
cur = gp.InsertCursor(table)
# Create the row
row = cur.NewRow()
# Add input to field 'Address'
row.Address = User_Address
# Insert the row
cur.InsertRow(row)
# Delete cursor
del cur
# Local variables...
Matched_address = "in_memory\\matched_address"
Address_Locator = "\\\\coggis01\\gis\\MapServices\\Tasks\\Address_Composite_Locator"
Success = "false"
Precincts = "Precincts"
Precincts__4_ = "Precincts"
Polling_Places = "Polling Places"
Polling_Places__3_ = "Polling Places"
# Process: Geocode Addresses...
gp.GeocodeAddresses_geocoding(table, Address_Locator, "STREET_ADDRESS Address VISIBLE NONE;NAME <None> VISIBLE NONE", Matched_address, "STATIC")
# Process: Check Match Results...
gp.toolbox = "C:/arcgis/ArcTutor/GP Service Examples/SelectingData/SelectionUtilities.tbx";
gp.CheckMatchResults(Matched_address, "Address", "0")
# Process: Select Layer By Location...
gp.SelectLayerByLocation_management(Precincts__4_, "INTERSECT", Matched_address, "", "NEW_SELECTION")
# Process: Make Feature Layer...
gp.MakeFeatureLayer_management(Precincts, Selected_Precinct, "", "", "Old_Dist Old_Dist VISIBLE NONE;Old_Numb Old_Numb VISIBLE NONE;New_Numb New_Numb VISIBLE NONE;Township Township VISIBLE NONE;Precinct Precinct VISIBLE NONE;Ward Ward VISIBLE NONE;Full_Name Full_Name VISIBLE NONE;GlobalID GlobalID VISIBLE NONE;Shape.area Shape.area VISIBLE NONE;Shape.len Shape.len VISIBLE NONE")
# Process: Add Join...
gp.AddJoin_management(Polling_Places__3_, "TOWNSHIP", Selected_Precinct, "Full_Name", "KEEP_COMMON")
# Process: Select by attributes...
gp.SelectLayerByAttributes_management(Polling_Places_3_, "NEW_SELECTION", "Madison_Web.DBO.PollPlace.TOWNSHIP = Madison_Web.DBO.Precincts.Full_Name")