<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic issue creating new sde connection files with arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/issue-creating-new-sde-connection-files-with-arcpy/m-p/373325#M29494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been creating new sde connection files in python (IDLE) just fine using the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
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)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Runtime error &amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: Failed to execute. Parameters are not valid. ERROR 000840: The value is not a Encrypted String. Failed to execute (CreateArcSDEConnectionFile).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get the same thing when I set &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;SDEPath = r"C:\myworkspace"&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; or any other literal path string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone have an idea of what is going on here?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Mar 2011 19:22:36 GMT</pubDate>
    <dc:creator>RuthEmerick</dc:creator>
    <dc:date>2011-03-23T19:22:36Z</dc:date>
    <item>
      <title>issue creating new sde connection files with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/issue-creating-new-sde-connection-files-with-arcpy/m-p/373325#M29494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been creating new sde connection files in python (IDLE) just fine using the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
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)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Runtime error &amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: Failed to execute. Parameters are not valid. ERROR 000840: The value is not a Encrypted String. Failed to execute (CreateArcSDEConnectionFile).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get the same thing when I set &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;SDEPath = r"C:\myworkspace"&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; or any other literal path string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone have an idea of what is going on here?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 19:22:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/issue-creating-new-sde-connection-files-with-arcpy/m-p/373325#M29494</guid>
      <dc:creator>RuthEmerick</dc:creator>
      <dc:date>2011-03-23T19:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: issue creating new sde connection files with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/issue-creating-new-sde-connection-files-with-arcpy/m-p/373326#M29495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SDEPath = r"C:\\myworkspace"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SDEPath = r"C:/myworkspace"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;either should work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2011 14:31:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/issue-creating-new-sde-connection-files-with-arcpy/m-p/373326#M29495</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-03-28T14:31:20Z</dc:date>
    </item>
  </channel>
</rss>

