<?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: Programmatically Creating Database Connections in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/programmatically-creating-database-connections/m-p/1569068#M73353</link>
    <description>&lt;P&gt;UPDATE: I ran&amp;nbsp;Create Database User with username GUINEA_PIG and a password.&amp;nbsp; This is on SQL Server .&amp;nbsp; I programmatically created two geodatabase connection (.sde) files using CreateDatabaseConnection: one for the old password and one for the new.&amp;nbsp; I gave the user permissions to some datasets.&amp;nbsp; I created a map and added some layers using the connection file.&amp;nbsp; I exited all GIS software.&amp;nbsp; Then I went into SQL Server Management Studio and changed the password for GUINEA_PIG to the new password.&amp;nbsp; Now neither the new connection file still nor the old one work.&amp;nbsp; In ArcGIS Pro, it prompts me in a dialog to provide the password.&amp;nbsp; In ArcMap, I get a Bad login user error message.&amp;nbsp; I know the new password matches the one I used in the CreateDatabaseConnection script.&lt;/P&gt;&lt;P&gt;Does anyone have any ideas on why creating a database connection file with a&amp;nbsp;&lt;EM&gt;future&lt;/EM&gt; good password wouldn't work?&lt;/P&gt;</description>
    <pubDate>Mon, 16 Dec 2024 21:09:14 GMT</pubDate>
    <dc:creator>RogerDunnGIS</dc:creator>
    <dc:date>2024-12-16T21:09:14Z</dc:date>
    <item>
      <title>Programmatically Creating Database Connections</title>
      <link>https://community.esri.com/t5/python-questions/programmatically-creating-database-connections/m-p/1548693#M73024</link>
      <description>&lt;P&gt;I am planning to change the database password for an enterprise geodatabase user to make it more secure.&amp;nbsp; This user's credentials appear in ArcGIS Pro projects' layers and tables, .sde files, ArcGIS Server services, the Server data store, and even in ArcMap documents.&lt;/P&gt;&lt;P&gt;ArcGIS Pro will not allow me to create a database connection file using the intended&amp;nbsp;&lt;EM&gt;new&lt;/EM&gt; password because of a Bad login user error.&amp;nbsp; I see no way to bypass this.&amp;nbsp; I was hoping to use the .sde file in my code with the &lt;FONT face="courier new,courier"&gt;updateConnectionProperties&lt;/FONT&gt; method.&amp;nbsp; But how can I supply &lt;FONT face="courier new,courier"&gt;current_connection_info&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;new_connection_info&lt;/FONT&gt; if I can't create both of them now?&lt;/P&gt;&lt;P&gt;To bypass the UI, I tried calling&amp;nbsp;&lt;FONT face="courier new,courier"&gt;arcpy.management.CreateDatabaseConnection&lt;/FONT&gt;&amp;nbsp;in a Python Notebook with the user's&amp;nbsp;&lt;EM&gt;current&lt;/EM&gt; password.&amp;nbsp; The resulting .sde file was unusable.&amp;nbsp; I believe it's because I can't supply an encrypted string for the &lt;FONT face="courier new,courier"&gt;password&lt;/FONT&gt; parameter.&amp;nbsp; A similar method, &lt;FONT face="courier new,courier"&gt;CreateDatabaseConnectionString&lt;/FONT&gt;, also expects an encrypted &lt;FONT face="courier new,courier"&gt;password&lt;/FONT&gt; string.&amp;nbsp; Encryption isn't the same as hashing, so I must suppose that ArcGIS Pro is using a private key with an algorithm to produce the needed argument for the function.&amp;nbsp; But how can I do this myself?&lt;/P&gt;&lt;P&gt;Any generic or specific help you can provide would be appreciated.&amp;nbsp; Your time is valuable; I am thankful you are spending some of it helping me.&amp;nbsp; Feel free to ask any questions, too.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 15:27:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/programmatically-creating-database-connections/m-p/1548693#M73024</guid>
      <dc:creator>RogerDunnGIS</dc:creator>
      <dc:date>2024-10-15T15:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically Creating Database Connections</title>
      <link>https://community.esri.com/t5/python-questions/programmatically-creating-database-connections/m-p/1548696#M73025</link>
      <description>&lt;P&gt;My apologies.&amp;nbsp; How embarrassing for me.&amp;nbsp; The password argument, passed as plain text, works&amp;nbsp; just fine.&amp;nbsp; I had programmatically created new and old password .sde files and it was the&amp;nbsp;&lt;EM&gt;new&lt;/EM&gt; ones that weren't working; the&amp;nbsp;&lt;EM&gt;old&lt;/EM&gt; ones are.&amp;nbsp; This is as it should be ,since the password hasn't been changed yet.&amp;nbsp; Well, maybe someone can benefit from this post.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 15:34:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/programmatically-creating-database-connections/m-p/1548696#M73025</guid>
      <dc:creator>RogerDunnGIS</dc:creator>
      <dc:date>2024-10-15T15:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically Creating Database Connections</title>
      <link>https://community.esri.com/t5/python-questions/programmatically-creating-database-connections/m-p/1569068#M73353</link>
      <description>&lt;P&gt;UPDATE: I ran&amp;nbsp;Create Database User with username GUINEA_PIG and a password.&amp;nbsp; This is on SQL Server .&amp;nbsp; I programmatically created two geodatabase connection (.sde) files using CreateDatabaseConnection: one for the old password and one for the new.&amp;nbsp; I gave the user permissions to some datasets.&amp;nbsp; I created a map and added some layers using the connection file.&amp;nbsp; I exited all GIS software.&amp;nbsp; Then I went into SQL Server Management Studio and changed the password for GUINEA_PIG to the new password.&amp;nbsp; Now neither the new connection file still nor the old one work.&amp;nbsp; In ArcGIS Pro, it prompts me in a dialog to provide the password.&amp;nbsp; In ArcMap, I get a Bad login user error message.&amp;nbsp; I know the new password matches the one I used in the CreateDatabaseConnection script.&lt;/P&gt;&lt;P&gt;Does anyone have any ideas on why creating a database connection file with a&amp;nbsp;&lt;EM&gt;future&lt;/EM&gt; good password wouldn't work?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 21:09:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/programmatically-creating-database-connections/m-p/1569068#M73353</guid>
      <dc:creator>RogerDunnGIS</dc:creator>
      <dc:date>2024-12-16T21:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically Creating Database Connections</title>
      <link>https://community.esri.com/t5/python-questions/programmatically-creating-database-connections/m-p/1590985#M73846</link>
      <description>&lt;P&gt;The database connections do work, but they can't both work in a session.&amp;nbsp; If a password is changed while an ArcGIS Pro session is underway, then the results are unpredictable.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 23:11:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/programmatically-creating-database-connections/m-p/1590985#M73846</guid>
      <dc:creator>RogerDunnGIS</dc:creator>
      <dc:date>2025-02-28T23:11:26Z</dc:date>
    </item>
  </channel>
</rss>

