My project aims at updating automatically point feature classes in a ESRI local geodatabase using MySQL tables with X,Y coordinates. The updates should be launched with the Windows task-scheduler. I am following closely the process described on blogs.esri.com, using ArcGIS 10.1 on Windows Server 2008 R2 Standard. I work in folder where I have full R/W permissions.
I have created the OLE DB connexion in ArcCatalog (following this GIS-SE post), and a ModelBuilder to run the conversion process. It works fine when launched in ArcCatalog.
I have created this ArcPy script to launch the ModelBuilder :
# -*- coding: utf-8 -*-
import arcpy
# Import the toolbox containing the model.
arcpy.ImportToolbox(r"c:\myTBX.tbx", "myTBX")
# Run the model "myTool". The model has two parameters:
# 1- the geodatabase to update
# 2- the input connection file to MySQL:
out_geodatabase = r"c:\mygeodatabase.gdb"
in_connection = r"c:\myConnection.odc"
arcpy.myTool_myTBX(out_geodatabase, in_connection)
print "process complete"
What I get is an errror message that says that the connection to MySQL does not exist or is not supported: the behaviour is different is I call the Model from within ArGIS (runs without error) or from ArcPy outside a user session (the connection to MySql is not recognized).
Does anyone know why this is happening, and how I could resolve it?