HOW TO
This document contains a script that will check all database connections and save the passwords in the project. You can use it as the shutdown script in a project to ensure all passwords are saved automatically.
Code:
theDocs = av.GetProject.GetDocs
theViews = {}
For Each aDoc in theDocs
'-- Get the views associated with the project
If (aDoc.GetClass.GetClassName = "View") then
'-- Get the themes from each view
theThemes = aDoc.GetThemes
For Each t in theThemes
'-- Get the SDE themes for the view
If (t.GetClass.GetClassName = "DBTheme") then
'-- Get each connection and save the password
qD = t.GetQueryDef
theCon = qD.GetConnection
theCon.SavePassword(TRUE)
End
End
End
'-- Get the database tables associated with the project
If (aDoc.GetClass.GetClassName = "DBTable") then
'-- Get the connection and save the password
tqD = aDoc.GetQueryDef
tableCon = tqD.GetConnection
tableCon.SavePassword(TRUE)
End
End
Note:
Follow the remaining steps if you want to make this the project shutdown script.
Article ID:000003437
Get help from ArcGIS experts
Download the Esri Support App