Python script runs in 10 but not 10.1 - using .odc connection

3365
22
Jump to solution
03-07-2013 04:41 AM
NathanHuggins
New Contributor
I currently have a script that pulls information from a Microsoft SQL Server Table View and exports it to a file geodatabase using an .odc connection. This script will run fine in version 10.0, but will error out using version 10.1. Giving the error message ERROR 000732: ... does not exist or is not supported. The strange thing is that I can build a model in ArcCatalog that will run successfully, then export that model to python, and that script will fail. So basically the geoprocessing tool will run with ArcCatalog open, but not as a python script.

Has ESRI changed something with regards to using .odc connections and MS SQL Server Views?? Or does anyone have a workaround? Below is some example code. Again runs fine in 10 but not in 10.1.

# Local variables: dbo_cosSewerManholes = "Database Connections\\Han8Live.odc\\dbo.cosSewerManholes" Infor_gdb = "D:\\Temp\\Infor.gdb"  # Process: Table to Table arcpy.TableToTable_conversion(dbo_cosSewerManholes, Infor_gdb, "manholes_view") print "done" 
Tags (2)
0 Kudos
22 Replies
ChrisFox3
Occasional Contributor III
Check my latest posts on the following ArcGIS Idea for information on a 64 bit version of ArcGIS Desktop:

64 Bit ArcGIS Desktop

In addition, at 10.1 you should start to consider if making an OLE DB connection is necessary. We now allow you to make a database connection to any of the following databases even if they don't contain an enterprise geodatabase:

�?� IBM DB2
�?� Informix
�?� Microsoft SQL Server
�?� Windows Azure SQL Database
�?� Netezza
�?� Oracle
�?� PostgreSQL

So for the majority of users they will only ever need to use the Add Database Connection command. The only time you would need to use an OLE DB Connection is if you need to connect to a database not in the list above. The original poster was working with SQL Server, so if you use a Database Connection instead you will be able to use this connection in 32 bit or 64 bit background.
0 Kudos
JacquelinePursell
Occasional Contributor
I am connecting to an access database.  I am on 10.2.2 desktop on my 10.2.1 ArcServer (windows 2012).  Is there a way around this yet?

My Oracle connections in my scripts work fabulous but I must connect to the Access database because not everyone here has made it to the 21st century haha...  I have created 4 models in a toolbox that I am calling and running, they work just fine in ArcCatalog but not in my script.

Referencing that 32 bit python in the task scheduler worked great.  I hope ESRI fixes this in future releases.
0 Kudos
curtvprice
MVP Esteemed Contributor
I have created 4 models in a toolbox that I am calling and running, they work just fine in ArcCatalog but not in my script.


How are you launching your script? If you are just double clicking or running from IDLE by default they will use x64 python and arcpy which will not work with your odbc connections.

Launch your script by explicitly running the 32-bit python from a command line or .bat file:

C:\Python27\ArcGIS10.2\python.exe my_script.py

More on this further up thread.

I am on 10.2.2 desktop on my 10.2.1 ArcServer

Are you sure? 10.2.2 is not released yet - and Desktop and Server co-installs must always be the exact same version.
0 Kudos