[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Visual Source Safe

Posted on 2001-07-12
Medium Priority
Last Modified: 2011-10-03
I am looking for detailed explanation / code Example on
how to do the following in VB , using VSS references:

1) Check out a file
2) Check in a file + Comments.
3) Get version X of file Y.

The VSS server is not sitting in the machine where
the vb app is running, but on server ZZZZ.


Question by:eofek
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 22

Expert Comment

ID: 6279072
First, VSS is intended as a client-server app in your scenario.  You need to install the client version of VSS on the client.

Once you've done that, start VB with the desired project.

You will probably be asked if you'd like to check it into source safe.  If so, you'll need to do administation to set up the project.

1) Check out a file
  Simply right-click on the desired form/class/module in the VB Project window and near the bottom you'll see "Check Out"

2) Check in a file + Comments.
  When done modifying, right-click as above and select "Check In..."  In the next window, enter comments then click OK.

3) Get version X of file Y.
  Go to Source Safe and locate the version you want and select each file, then right-click and select View, then "check out this..."

Expert Comment

ID: 6279614
Open Visual Sourcesafe admin
First you have to create a database.
Goto Tools - Create Database
Choose the directory name or enter a new name

Then you have to create a user account in VSS.
Users - Adduser option

You have the options to set user rights etc in Tools menu itself.
Next Open  Microsoft Visual SourceSafe
Browse the directory where you have created the database
Type in user name and password

Visual Sourcesafe Explorer window will open with $ directory open.
Goto File- create project and create a project
Add the files required (your frm,vbp,frx files) by File- Add files option

Once you use add files to the sourcesafe it will get added to vss database. But you require  a directory to checkout files. You can set it by File - set working folder option.
When ever you checkout a file source safe will overwrite the local copy in this directory from the VSS database.

You can checkout files using vss or vb.
Tools - sourcesafe - Checkout
Select the forms or modules or files required

You can checkout the entire project from VSS by rightclicking on the project name and choosing check out option.

To get a specific version using Vb
Tools - sourcesafe - Show history
Click on Ok without entering form  or to
Now it will display all the versions
Choose the version and click Get button

When ever you make a change in a file and check in, it will update the VSS, and creates a new version.



Expert Comment

ID: 6280027
I think he wants to know how to do it in code...

Theres an excellent article on how to do Sourcesafe automation on the MSDN web site, and there is a sample project for VB (the whole SourceSafe explorer, written in VB).  Go to http://msdn.microsoft.com/vstudio
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 6280349
yes Anthony. Now I think so. Any way he hasn't responded. Lets see

Expert Comment

ID: 6280839

Author Comment

ID: 6282026
Sorry for the late response.
Anthony is very correct.
a sample project of a VSS written in VB is exactly what I need ( even better).
But I couldn't find it inthe link you gave.
Could you please give the full link to the download page of this specific sample ?
I tried looking for it but couldn't find it.



Accepted Solution

anthony_glenwright earned 800 total points
ID: 6282998
The article is here:


Good luck!

Note:  A tip - when you first use ...
Private WithEvents SourceSafeInstance As SourceSafeTypeLib.VSSApp

... to sink events, you will have problems in VB(6) because they used a VB reserved word in all the event templates...

Pretty silly, huh (-:   You can fix it by doing a search/replace, replacing all instance of "Local" with "strLocal" (I think thats the one - it was a while ago...)

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question