Microsoft KB Archive/156878

= FIX: Checking Out .vbp Overwrites Unsaved Changes in Project =

Article ID: 156878

Article Last Modified on 6/28/2004

-

APPLIES TO


 * Microsoft Visual SourceSafe 4.0 Standard Edition
 * Microsoft Visual SourceSafe 4.0a
 * Microsoft Visual SourceSafe 5.0 Standard Edition
 * Microsoft Visual SourceSafe 4.0 Standard Edition
 * Microsoft Visual SourceSafe 4.0a
 * Microsoft Visual SourceSafe 5.0 Standard Edition
 * Microsoft Visual SourceSafe 5.0 Standard Edition
 * Microsoft Visual Basic 4.0 16-bit Enterprise Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

-



This article was previously published under Q156878



SYMPTOMS
If you have checked out and modified files from a project that is under SourceSafe control without checking out the .vbp file, unsaved changes to those files will be erased without warning if you then check out the .VBP.



WORKAROUND
Either checkout the VBP file before modifying any file in the project or save all modified files in the project before checking out the VBP file.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual SourceSafe version 6.0 for Windows.



Steps to Reproduce Problem
Steps one through five can be omitted if you already have a Visual Basic project under SourceSafe control with all files checked in.


 * 1) Start Visual Basic 4.0. A default project is created.
 * 2) Save the project, form1.frm & project1.vbp, in a new directory such as C:\temp\testme.
 * 3) Click Yes in the messagebox asking you if the project should be added to SourceCode control.
 * 4) Click Create in the Add SourceSafe Project dialog, then click Yes when prompted to create the project. The default name is Project1.
 * 5) Add both files to the SourceSafe project in the Add to SourceSafe dialog. By default, both files are now checked in. In the Visual Basic 4.0 project window, form1.frm is now correctly marked as read-only.
 * 6) In the Visual Basic 4.0 project window, right-click the line containing form1.frm, and invoke the Check Out command.
 * 7) In the Check Out File(s) from SourceSafe dialog, only form1.frm is selected. Click OK to check out only form1.frm. Do not check out project1.vbp. The bitmap in the Visual Basic 4.0 project window now shows that form1.frm is checked out.
 * 8) Click View Form in the Visual Basic project window and make some changes to the form, such as placing a Command button on the form.
 * 9) Right-click again on form1.frm in the Visual Basic 4.0 project window, and choose the Check Out command. You will find only project1.vbp in the list of Files to be checked out. Select the file and check it out. Note that Form1.frm is replaced by its previous version without any warning.

The same behavior, such as unsaved changes being overwritten, will happen to any component in the project when the VBP file is checked out.

Additional query words: module

Keywords: kbbug kbfix kbssafe600fix kbinterop KB156878

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.