Object Reference not set to an instance of an object

4489
3
08-17-2012 06:50 AM
JohnDye
Occasional Contributor III
I'm trying to batch a trade area creation process. We have over a thousand of them to do but I'm just testing with 5 tables right now. In any case, I've created the script but it keeps erroring out with the error:

An unhandled exception has occured in Business Analyst. Please contact your system Administrator.

Object reference not set to an instance of an object.

I've embeded a copy of the script and the error I'm receiving. I can't click on details because I have to cancel the script first...which it won't cancel so I have to shut it down via the Task Manager which closes the entire ArcGIS application I'm running the script tool from.

[ATTACH=CONFIG]17039[/ATTACH]
[ATTACH=CONFIG]17041[/ATTACH]
0 Kudos
3 Replies
MikeHunter
Occasional Contributor
I'm not that familiar with the functions you are using, but right off the bat I notice that the name "Table" is unreferenced in the line with ValidateTableName.  That's supposed to be a string denoting the name of the table in the given workspace.  The name Table at this point in your script does not point to anything.

good luck,
Mike
0 Kudos
by Anonymous User
Not applicable
Original User: johnmdye

Thanks Mahunter243,
ESRI Technical Support pointed out the same thing. I moved the OutFC reference to be inside the loop so that it can reference the table created by the for loop. However, that didn't change anything. I still received the same error. Here's a copy of the updated script and the persisting error. I even tried just completely removing the arcpy.ValidateTableName function and just using the table name by naming the output feature class as <Table + "_TradeArea"> but still received the object not referenced error.

[ATTACH=CONFIG]17211[/ATTACH]
[ATTACH=CONFIG]17213[/ATTACH]
0 Kudos
JohnDye
Occasional Contributor III
Update: There was an issue with the table schema, not the code.
0 Kudos