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.
'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
' 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
theFName = "Insert path to real APR".asfilename
if (nil <> theFName) then
if (nil <> theProject) then
theProject = nil
av.DelayedRun("Project.OpenPart2", theFName, 0)
'End of Script