Select to view content in your preferred language

Repointed MXD asks user to enter old 'Spatial Database Connection' info on 1st launch

1527
1
02-29-2012 06:41 AM
mvisekru
Occasional Contributor
I have a python script that re-points SDE feature classes in an MXD from one SDE server to another one and saves a new copy of the MXD.

Everything works great, however when opening the newly saved MXD that's pointed to the new server for the first time the user is promped to enter their username and password in 'Spatial Database Connection' for the OLD server + the NEW server.

If the user hits cancel on the 'Spatial Database Connection' popup for the old server and only enters their credentials for the new one server, saves the MXD, the next time it's opened, it will not prompt the user with the 'Spatial Database Connection' with the OLD server, only the NEW one.

Again, this only happens the first time the MXD is opened, once it's been opened and saved it's no longer an issue. Just wondering if there's a away to get rid of this annoyance any way?

Thanks!
Tags (2)
0 Kudos
1 Reply
MichaelVolz
Esteemed Contributor
Miroslav:

I have also created a script that performs this task but I do not need to specify credentials as you say when I open the new mxd.  Are you using the ReplaceDataSource method to make this server switch?

Also, I have the script loop through all subfolders in a user selected folder where it targets mxd files and changes the SDE connection from one SDE server to another.  The problem I have is that the memory keeps building up until the script locks up.  Do you perform this script on one mxd at a time or is it a batch process?

If its a batch process and you do not have a memory buildup, I would be interested in taking a look at your python code.  Thanks.
0 Kudos