Select to view content in your preferred language

"Database Connections" path in standalone script

78
1
Jump to solution
yesterday
DORPAD
by
Emerging Contributor

 

Hello all,

I have a inherited an old standalone python script that I'm trying to update, and it has the following line...

sde_prcls = r"Database Connections\prod.sde\GISSDE.GISDO.parcels"

 

What the heck is the start of that path, "Database Connections" referring to?  The SDE connection files are stored within project folders and user data, but nothing explicitly labeled "Database Connections", as far as I can tell.

The script runs correctly, and I'm all about "if it ain't broke...", but I'd be curious as to what exactly is going on here, and whether it is something that ought to be replaced following best practices.

Thanks in advance 

0 Kudos
1 Solution

Accepted Solutions
StefanSimon
New Contributor

Hi,

"Database Connections" is a virtual path used by ArcMap/ArcCatalog. It's an alias for the user's specific profile folder where .sde files are stored, typically: C:\Users\<YourUsername>\AppData\Roaming\ESRI\Desktop10.x\ArcCatalog [1]

Even though it works, I'm replacing it. It's a fragile "anti-pattern" because it's:

  • User-Dependent: Fails for any other user.
  • Version-Dependent: Breaks when ArcGIS is upgraded.
  • Obscure: Hard to debug and deploy.

I'll be switching to an explicit  path to the .sde file accessible to the script.

[1] https://desktop.arcgis.com/en/arcmap/latest/manage-data/databases/database-connections-desktop.htm

View solution in original post

1 Reply
StefanSimon
New Contributor

Hi,

"Database Connections" is a virtual path used by ArcMap/ArcCatalog. It's an alias for the user's specific profile folder where .sde files are stored, typically: C:\Users\<YourUsername>\AppData\Roaming\ESRI\Desktop10.x\ArcCatalog [1]

Even though it works, I'm replacing it. It's a fragile "anti-pattern" because it's:

  • User-Dependent: Fails for any other user.
  • Version-Dependent: Breaks when ArcGIS is upgraded.
  • Obscure: Hard to debug and deploy.

I'll be switching to an explicit  path to the .sde file accessible to the script.

[1] https://desktop.arcgis.com/en/arcmap/latest/manage-data/databases/database-connections-desktop.htm