Select to view content in your preferred language

issue creating new sde connection files with arcpy

782
1
03-23-2011 12:22 PM
RuthEmerick
Emerging Contributor
I've been creating new sde connection files in python (IDLE) just fine using the following code:

import arcpy
SDEPath = "Database Connections"
SDEName = "Connection to myservername.sde"
serverName = "myservername"
serviceName = "5151"
databaseName = "mydatabasename"
authType = "OPERATING_SYSTEM_AUTH"
arcpy.CreateArcSDEConnectionFile_management(SDEPath , SDEName, serverName, serviceName, databaseName, authType)


These connections work just fine, they show up in ArcCatalog, etc. When I attempt to use the same code in the ArcGIS python interpreter, I get the following error and no connection is created:

Runtime error <class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid. ERROR 000840: The value is not a Encrypted String. Failed to execute (CreateArcSDEConnectionFile).

I get the same thing when I set
SDEPath = r"C:\myworkspace"
or any other literal path string.

Anyone have an idea of what is going on here?
Tags (2)
0 Kudos
1 Reply
by Anonymous User
Not applicable
I would try

SDEPath = r"C:\\myworkspace"

or

SDEPath = r"C:/myworkspace"

either should work.
0 Kudos