Select to view content in your preferred language

Prompted for Database Connection even when all layers are correctly sourced

185
7
3 weeks ago
Labels (2)
EdwardBlair
Regular Contributor

We've got numerous detailed maps with feature layers that we want to "swizzle" to point to a new Geodatabase.   This works is most cases, however there are a few cases where, even after all feature layer data sources have been changed, when opening the map we are prompted to enter a database connection.

In some cases, simply saving and closing the map document resolves the issue.   But in some cases not.

Its as if the MXD has a broken database reference that is *not* among the map's feature layers.  

Any suggestions would be much appreciated.

Thx,

Ed

0 Kudos
7 Replies
ChrisUnderwood
Esri Contributor

Hello @EdwardBlair , you could try listing any broken data sources in your MXD. The code sample in the Help is relatively simple.

https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/listbrokendatasources.htm

 

0 Kudos
EdwardBlair
Regular Contributor

Hi Chris -

Thanks for the reply.

The thing is, there are no broken data sources in the MXD.  All layers are hooked up correctly to sources.   But we still get prompted for a database connection.

Ed

0 Kudos
RhettZufelt
MVP Notable Contributor

I have seen in the past where ArcMap (especially earlier versions) will NOT let go of previous data connections.  Even Defrag and Mxd Doctor will not 'fix' the issue.

The only 'fix' for this I've seen in the past is to copy ALL the layers in the Data Frame and paste into a new Dataframe in a new ArcMap document.

R_

EdwardBlair
Regular Contributor

Rhett -

Thanks for the insights.    Out of curiosity I tried both MXD Doctor and the Defragmenter and, as you suspected, neither of these identified or fixed the problem.    

Ed

0 Kudos
MichaelVolz
Esteemed Contributor

Can you try a Save A Copy on the file before updating the database connections?  If you compare the file sizes of the mxds, it usually is much less in the copy as this operation appears to clean out items from the mxd that are not being used.

0 Kudos
EdwardBlair
Regular Contributor

Michael -

Thanks for your suggestion to use "Save A Copy".   I tried this and it worked for one of my MXDs (though not all).

So... many thanks!

But (and I don't mean to look a gift horse in the mouth) is there a way know what "wasn't being used"?    These MXDs are complex animals.   With joins, relates, definition queries, excluded features, etc. etc.  Is there a way for me to know what got left behind?

BTW - I found that an MXD *not* resolved by your suggestion was one that had a definition query based on a join - and the join was not updated.   And now I at least know to account for that case.

Thanks again for you suggestion.   Much appreciated.  

Ed

0 Kudos
EdwardBlair
Regular Contributor

Hi Chris -

Just wanted to let you know that I tried the python script you suggested.   It didn't find anything broken, but we still get prompted for a database connection when opening the MXD.

Ed

0 Kudos