HOW TO
Problems can occur when opening a project that references SQL tables if it is opened by double-clicking the APR file. The SQL connection is attempted before ArcView is fully initialized and errors may occur.The recommended method for opening projects is to start ArcView, select File > Open Project and select the project you wish to open.
Code:
'This code is modified from the Project.Open System script.
theProject = av.GetProject
'if (nil <> theProject) then
'if (theProject.IsModified) then
' if (av.Run("Project.CheckForEdits",nil).Not) then
' return nil
' end
' res = MsgBox.SaveChanges("Do you want to save changes to "
' + theProject.GetName + "?", "ArcView", true)
' if (nil = res) then return nil end
' if (res) then
' av.Run("Project.Save", nil)
' if (theProject.IsModified)then return nil end
' end
' end
'end
theFName = "Insert path to real APR".asfilename
if (nil <> theFName) then
if (nil <> theProject) then
theProject.Close
end
theProject = nil
av.ClearGlobals
av.DelayedRun("Project.OpenPart2", theFName, 0)
end
'End of Script
Article ID:000005226
Get help from ArcGIS experts
Download the Esri Support App