Learn how to a build a cloud-first strategyRegister 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
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

810 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