shaunareed2152

Python Script not working for ModelBuilder, ... Unspecified Error ...

Discussion created by shaunareed2152 on Jun 15, 2011
Latest reply on Jun 22, 2011 by DChristy-esristaff
I have a ModelBuilder that I created a Script for Python from so that I can Automate the GDB creation...  It ran successful for me once, but now has some errors not letting it work. Below is the Python Script Summary and ERROR message... Any help on this would be greatful. 
Shauna Reed
GIS Administrator
Peace River Electric Cooperative

# ---------------------------------------------------------------------------
# Milsoft_GDB.py
# Created on: Wed Jun 15 2011 04:45:07 PM
#   (generated by ArcGIS/ModelBuilder)
# ---------------------------------------------------------------------------

# Import system modules
import sys, string, os, win32com.client

# Create the Geoprocessor object
gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")

# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx")
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")


# Local variables...
Friday_mdb = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb"
Friday_Model = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model"
Friday_mdb__4_ = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb"
PRECO20_ArcExisting_SDE_CAPC = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.CAPC"
PRECO20_ArcExisting_SDE_CONDUCT = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.CONDUCT"
PRECO20_ArcExisting_SDE_CONDUCTN = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.CONDUCTN"
PRECO20_ArcExisting_SDE_CUSTMR = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.CUSTMR"
PRECO20_ArcExisting_SDE_LIGHT = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.LIGHT"
PRECO20_ArcExisting_SDE_POLE = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.POLE"
PRECO20_ArcExisting_SDE_SUBSTAT = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.SUBSTAT"
PRECO20_ArcExisting_SDE_SWITCH = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.SWITCH"
PRECO20_ArcExisting_SDE_UGFAC = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.UGFAC"
PRECO20_ArcExisting_SDE_VOLTREG = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.VOLTREG"
PRECO20_ArcExisting_SDE_XFMR = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.XFMR"
PRECO20_ArcExisting_SDE_XMISSION = "C:\\Milsoft\\Python\\Connection to precouai.sde\\PRECO20_ArcExisting.sde.EXISTING_ELECTRIC\\PRECO20_ArcExisting.SDE.XMISSION"
Capc = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Capc"
Conduct = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Conduct"
ConductN = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\ConductN"
Custmr = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Custmr"
Light = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Light"
Pole = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Pole"
Substat = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Substat"
Switch = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Switch"
Ugfac = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Ugfac"
Voltreg = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Voltreg"
Xfmr = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Xfmr"
Xmission = "D:\\Milsoft Data Conversions\\OMS_Model_Access\\Friday_Model\\Friday.mdb\\Xmission"

# Process: Create Personal GDB...
gp.CreatePersonalGDB_management(Friday_Model, "Friday")

# Process: Feature Class To Feature Class...
gp.FeatureClassToFeatureClass_conversion(PRECO20_ArcExisting_SDE_CAPC, Friday_mdb, "Capc", "", "PRIKEY PRIKEY VISIBLE;SEDCWONUM SEDCWONUM VISIBLE;STAKER STAKER VISIBLE;JOBISSUER JOBISSUER VISIBLE;WORKMGMT WORKMGMT VISIBLE;COMMENTS COMMENTS VISIBLE;PHASE PHASE VISIBLE;QTY QTY VISIBLE;CAPKVAR CAPKVAR VISIBLE;EQUIPID

... and so on ...

# Process: Compact...
gp.Compact_management(Friday_mdb)

-----------------------------------------------------------------
ERROR MESSAGE...

PythonWin 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32.
Portions Copyright 1994-2001 Mark Hammond (mhammond@skippinet.com.au) - see 'Help/About PythonWin' for further copyright information.
Traceback (most recent call last):
  File "C:\Python21\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Milsoft\Python\Milsoft_GDB.py", line 48, in ?
    gp.CreatePersonalGDB_management(Friday_Model, "Friday")
  File "<COMObject esriGeoprocessing.GpDispatch.1>", line 2, in CreatePersonalGDB_management
com_error: (-2147467259, 'Unspecified error', None, None)

Outcomes