When you try to rename or try to move a Microsoft Project
project file (*.mpp) that is in a network share or on your local hard
disk drive, you may receive a sharing violation error
message. Additionally, when you open the project file, changes that you made to the file
are missing.
If you view open connections for the
server or the
computer
where the project file is shared from,
the project file is listed with a live connection to a user, even though the
file may not be in use by that user.
This problem may occur if you use the ConData object in a
script from an ASP page to load a Microsoft Project *.mpp project file with the
following ADO Provider connection string:
Provider=Microsoft.Project.OLEDB.version_number;PROJECT NAME=Project_Path_File_Name.mpp
When the *.mpp file is loaded and is served out by using this ADO
Provider connection string, the file is opened in Read mode and a Read lock is
set on the file on the server. This Read lock will remain active until another
project file is loaded with the same connection method, or until you unload the
ADO Provider. When the server provides the new project file, the Read lock is
removed from first project file.
To work around this problem, follow these steps in the order
that they appear:
- Create a blank *.mpp project file.
- Save the file on the server.
- Modify the original script on the ASP page.
- Add the follow code after the first ConData object
allocation:
Set ConData = Server.CreateObject("ADODB.Connection")
ConData.ConnectionString = "Provider=Microsoft.Project.OLEDB.version_number;PROJECT NAME=c:\path\blank_project.mpp"
ConData.Open
ConData.Close
Set ConData = Nothing
After you run the code, the original *.mpp project file that was
locked is released and the lock remains on the blank *.mpp project file.
The provider supports three registry entries
that determine the number of seconds that must elapse before certain time-out
conditions occur. These registry entries
can be found under the following subkey:
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\<version_#>.0\MS Project\OLE
DB Provider
Entry Name: TimeoutOnLoad
Type: DWORD
Value: Time in seconds the provider will try to load a project before
returning an error message that the project is unavailable. Default value is 90
seconds.
Entry Name: TimeBeforeUnload
Type: DWORD
Value: Time in seconds the project remains open after another project
is loaded. Until a new project is loaded, the current project remains in
memory, regardless of this setting. Default value is 600 seconds.
Entry Name: TimeBeforeRefresh
Type: DWORD
Value: Time in seconds before the current project is checked for
updated information. Default value is 1 second.
If you set any one of
these entries to zero, the features of that entry are turned off. If you set
the TimeBeforeUnload entry to zero,
the workaround that is described in this article does not work. If you set the TimeBeforeUnload entry to a low
value, less than 60 seconds, a high load situation may occur as the provider
will constantly reload projects.
Microsoft
has confirmed that this is a problem in the Microsoft products that are listed
in the "Applies to" section.