<?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 Re: How to handle sde database connections? in Python AddIns Questions</title>
    <link>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779532#M41</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could store the connection file with your script and get the home path of the script see below. That would take away the ability to use it somewhere else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;hmpath = os.path.realpath(__file__)
h,t = os.path.split(hmpath)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 08:47:42 GMT</pubDate>
    <dc:creator>WesMiller</dc:creator>
    <dc:date>2021-12-12T08:47:42Z</dc:date>
    <item>
      <title>How to handle sde database connections?</title>
      <link>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779527#M36</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm about ready to deploy an add-in but I'm not sure how to handle database connections.&amp;nbsp; I know I can include files used by the add-in (ArcCatalog database connection file?) in the install directory for packaging when the add-in file is created, but how do i code the file location?&amp;nbsp; I can include the path to the file that is used while developing, but won't that change when it's all packaged into the .esriaddin file?&amp;nbsp; Also, "in_memory" doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2016 12:43:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779527#M36</guid>
      <dc:creator>BradJones</dc:creator>
      <dc:date>2016-04-29T12:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle sde database connections?</title>
      <link>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779528#M37</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/create-arcsde-connection-file.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/create-arcsde-connection-file.htm"&gt;Create ArcSDE Connection File—Help | ArcGIS for Desktop&lt;/A&gt; this is the best way to handle server connections that I've found. Place the connection file in a central location that all users can access. I've been able to use "in_memory workspace in add-ins do you have an example of what you are trying to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2016 12:45:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779528#M37</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-04-29T12:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle sde database connections?</title>
      <link>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779529#M38</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I said &lt;STRONG&gt;in_memory&lt;/STRONG&gt; doesn't work I meant as the &lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px;"&gt;&lt;STRONG&gt;out_folder_path&lt;/STRONG&gt; with &lt;STRONG&gt;CreateDatabaseConnection_management.&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;We restrict most users to &lt;STRONG&gt;.lyr&lt;/STRONG&gt; files which have the database connections included in the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Python add-in documentation:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="File and folder structure" class="jive-image" src="http://desktop.arcgis.com/en/arcmap/10.3/guide-books/python-addins/GUID-3D5A3BD6-163D-4B6B-AFA1-8F724B169E9A-web.png" /&gt;&lt;/P&gt;&lt;P&gt;Packaging data and toolboxes in the install directory would be pretty handy in this situation.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could create the file in a directory then delete it after.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2016 13:38:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779529#M38</guid>
      <dc:creator>BradJones</dc:creator>
      <dc:date>2016-04-29T13:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle sde database connections?</title>
      <link>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779530#M39</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just as a thought you could put the connection file in the same directory as the .lyr files that your users already have access.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2016 14:05:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779530#M39</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-04-29T14:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle sde database connections?</title>
      <link>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779531#M40</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, I think that's what I will do.&amp;nbsp; The idea of having everything in one file that I could send to people that they could double click and install was enticing. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2016 14:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779531#M40</guid>
      <dc:creator>BradJones</dc:creator>
      <dc:date>2016-04-29T14:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle sde database connections?</title>
      <link>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779532#M41</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could store the connection file with your script and get the home path of the script see below. That would take away the ability to use it somewhere else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;hmpath = os.path.realpath(__file__)
h,t = os.path.split(hmpath)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:47:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-addins-questions/how-to-handle-sde-database-connections/m-p/779532#M41</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2021-12-12T08:47:42Z</dc:date>
    </item>
  </channel>
</rss>

