Select to view content in your preferred language

addDataFromPath credential error

1139
4
Jump to solution
02-12-2024 12:21 PM
JillianStanford
Frequent Contributor

Hi,

I am trying to add a feature layer in a geodatabase on a network share to a map.

Using the following tool works without issue:

JillianStanford_0-1707769062494.png

The layer is added to the current map.

If I attempt to do this using Python, I get the following error about credentials.

JillianStanford_1-1707769125595.png

Any ideas on how to resolve this?

Thanks!

Jill

 

 

0 Kudos
1 Solution

Accepted Solutions
RhettZufelt
MVP Notable Contributor

I get different error, but what about declaring the path as a raw string?

newLayer = m.addDataFromPath(r'\\dotims4\maps\accela_update\accell_data.gdb\parcelPoint')

R_

View solution in original post

4 Replies
RhettZufelt
MVP Notable Contributor

I get different error, but what about declaring the path as a raw string?

newLayer = m.addDataFromPath(r'\\dotims4\maps\accela_update\accell_data.gdb\parcelPoint')

R_

FredericPoliart_EsriAU
Frequent Contributor

you cannot use relative paths, it is considered a security issue (it seems)
Put the full path to your .gdb or your .sde file 


0 Kudos
JillianStanford
Frequent Contributor

The relative path worked fine once I declared it as a raw string.

Thanks!

0 Kudos
jorisfrenkel
Frequent Contributor

Fun fact: I received this error when the layer file (.lyrx) I wanted to load didn't exist.

0 Kudos