<?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 Creation of database connection does not work on ArcGIS Server 11 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creation-of-database-connection-does-not-work-on/m-p/1275167#M67928</link>
    <description>&lt;P&gt;I have a snippet that creates a database connection to an enterprise geodatabase, then list the tables:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
new_conn2 = arcpy.management.CreateDatabaseConnection(r"c:\temp", "Myconnection2", "SQL_SERVER", "MySQLServer",                                           account_authentication="DATABASE_AUTH",
                                          username="myUser", 
                                          password="mySecretPassword", 
                                          save_user_pass="SAVE_USERNAME", database="myEGDB")
print(arcpy.Describe(new_conn2[0]).dataElementType)
arcpy.env.workspace = new_conn2[0]

# Get and print a list of tables
tables = arcpy.ListTables()
for table in tables:
    print(table)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the output when I run the snippet in ArcGIS Pro 3.0 is:&lt;/P&gt;&lt;PRE&gt;'DEWorkspace'&lt;/PRE&gt;&lt;PRE&gt;DATAOWNER.P_Centerline_Sequence
DATAOWNER.P_DocumentPoint__ATTACH
DATAOWNER.P_CasingInspection
DATAOWNER.P_CPBondInspection
DATAOWNER.P_CPRectifierInspection
DATAOWNER.P_CPTestPointReading
DATAOWNER.P_CrossingInspection
DATAOWNER.P_ElectricSurvey
DATAOWNER.P_ExcavationDamage__ATTACH
DATAOWNER.P_ExposedPipeInspect__ATTACH
DATAOWNER.P_GasLeak__ATTACH
DATAOWNER.P_GasLeakInspect&lt;BR /&gt;.....&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the same code in ArcGIS Server python instance the output is:&lt;/P&gt;&lt;PRE&gt;'DEFile'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the Python3 command prompt as well as the Jupyter notebook present in the ArcGIS Server installation.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/151965"&gt;@BrianClee&lt;/a&gt;&amp;nbsp; or&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1184"&gt;@GhislainPrince&lt;/a&gt;&amp;nbsp; do you have any idea about this?&lt;/P&gt;</description>
    <pubDate>Tue, 04 Apr 2023 11:20:51 GMT</pubDate>
    <dc:creator>Cristian_Galindo</dc:creator>
    <dc:date>2023-04-04T11:20:51Z</dc:date>
    <item>
      <title>Creation of database connection does not work on ArcGIS Server 11</title>
      <link>https://community.esri.com/t5/python-questions/creation-of-database-connection-does-not-work-on/m-p/1275167#M67928</link>
      <description>&lt;P&gt;I have a snippet that creates a database connection to an enterprise geodatabase, then list the tables:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
new_conn2 = arcpy.management.CreateDatabaseConnection(r"c:\temp", "Myconnection2", "SQL_SERVER", "MySQLServer",                                           account_authentication="DATABASE_AUTH",
                                          username="myUser", 
                                          password="mySecretPassword", 
                                          save_user_pass="SAVE_USERNAME", database="myEGDB")
print(arcpy.Describe(new_conn2[0]).dataElementType)
arcpy.env.workspace = new_conn2[0]

# Get and print a list of tables
tables = arcpy.ListTables()
for table in tables:
    print(table)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the output when I run the snippet in ArcGIS Pro 3.0 is:&lt;/P&gt;&lt;PRE&gt;'DEWorkspace'&lt;/PRE&gt;&lt;PRE&gt;DATAOWNER.P_Centerline_Sequence
DATAOWNER.P_DocumentPoint__ATTACH
DATAOWNER.P_CasingInspection
DATAOWNER.P_CPBondInspection
DATAOWNER.P_CPRectifierInspection
DATAOWNER.P_CPTestPointReading
DATAOWNER.P_CrossingInspection
DATAOWNER.P_ElectricSurvey
DATAOWNER.P_ExcavationDamage__ATTACH
DATAOWNER.P_ExposedPipeInspect__ATTACH
DATAOWNER.P_GasLeak__ATTACH
DATAOWNER.P_GasLeakInspect&lt;BR /&gt;.....&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the same code in ArcGIS Server python instance the output is:&lt;/P&gt;&lt;PRE&gt;'DEFile'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the Python3 command prompt as well as the Jupyter notebook present in the ArcGIS Server installation.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/151965"&gt;@BrianClee&lt;/a&gt;&amp;nbsp; or&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1184"&gt;@GhislainPrince&lt;/a&gt;&amp;nbsp; do you have any idea about this?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 11:20:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creation-of-database-connection-does-not-work-on/m-p/1275167#M67928</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-04-04T11:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of database connection does not work on ArcGIS Server 11</title>
      <link>https://community.esri.com/t5/python-questions/creation-of-database-connection-does-not-work-on/m-p/1275213#M67929</link>
      <description>&lt;P&gt;Following the recommendation of the page&amp;nbsp;&lt;A href="https://enterprise.arcgis.com/en/system-requirements/latest/windows/database-requirements-sqlserver.htm" target="_blank" rel="noopener"&gt;https://enterprise.arcgis.com/en/system-requirements/latest/windows/database-requirements-sqlserver.htm&lt;/A&gt;&amp;nbsp;I downloaded from Microsoft site the latest version of the ODBC driver version 18, that is the one that I installed in &lt;STRONG&gt;both&lt;/STRONG&gt; machines (Client and Server):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-04-04_14-33-54.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67187i9AE120320EE90DC5/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-04-04_14-33-54.png" alt="2023-04-04_14-33-54.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV class=""&gt;A colleague&amp;nbsp; recommend me to install the ODBC driver provided by ESRI, I proceed to install it:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-04-04_14-37-08.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67188i6262FC0B44ECCA38/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-04-04_14-37-08.png" alt="2023-04-04_14-37-08.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Now the result of the snippet is the one expected:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-04-04_14-39-09.png" style="width: 994px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67184i82F93D5C4C5E3F92/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-04-04_14-39-09.png" alt="2023-04-04_14-39-09.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Conclusion: ArcGIS server 11 has an issue with the ODBC Driver version 18.6.3&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 12:51:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creation-of-database-connection-does-not-work-on/m-p/1275213#M67929</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-04-04T12:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of database connection does not work on ArcGIS Server 11</title>
      <link>https://community.esri.com/t5/python-questions/creation-of-database-connection-does-not-work-on/m-p/1276390#M67930</link>
      <description>&lt;P&gt;Did you try to set the workspace as a variable instead of creating the 'CreateDatabaseConnection()' command?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

# Create a database connection to an enterprise geodatabase
db_path = r"c:\temp\Myconnection2.sde"
arcpy.management.CreateDatabaseConnection(db_path, "Myconnection2", "SQL_SERVER", "MySQLServer",
account_authentication="DATABASE_AUTH",
username="myUser",
password="mySecretPassword",
save_user_pass="SAVE_USERNAME", database="myEGDB")

# Set the workspace to the database connection file path
arcpy.env.workspace = db_path

# Get and print a list of tables
tables = arcpy.ListTables()
for table in tables:
print(table)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 Apr 2023 21:53:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creation-of-database-connection-does-not-work-on/m-p/1276390#M67930</guid>
      <dc:creator>avonmoos</dc:creator>
      <dc:date>2023-04-06T21:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creation of database connection does not work on ArcGIS Server 11</title>
      <link>https://community.esri.com/t5/python-questions/creation-of-database-connection-does-not-work-on/m-p/1277168#M67931</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I tried what you mentioned, but I thought I had a typo in my code I decided to use the path generated by the tool that creates the file.&lt;/P&gt;&lt;P&gt;But in order to understand the logic behind your suggestion, could you explain me why using the result of the tool's execution would be an issue?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 06:43:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creation-of-database-connection-does-not-work-on/m-p/1277168#M67931</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-04-11T06:43:26Z</dc:date>
    </item>
  </channel>
</rss>

