Microsoft Visual SourceSafe provides an automation interface that can be used from within VBScript, VB6 and other languages. This article lists the options for automating SourceSafe, provides links to documentation, and discusses some bugs that are impossible to work around.
Documentation
I am in the unenviable position of needing to write a VBScript program to interact with SourceSafe. Unfortunately the documentation is hard to find and not at all clear or user-friendly. Here are the two links I find useful:
- Visual SourceSafe 6.0 Automation is a poorly-written, incomplete, hard-to-follow, unstructured attempt to jam documentation and an article together. A far cry from Microsoft’s usually excellent documentation.
- Visual SourceSafe OLE Automation Constants. You will need these constants because the previous article doesn’t define values for any of the constants.
Bugs
I notice a number of bugs. For instance, no matter what I do, I cannot get the IVSSItem.Get or IVSSItem.CheckOut methods working in VBScript (they do work in VB6). I just get strange errors about “Type mismatch” or “Invalid DOS path:” depending on how I call the method. I see others on the web have had the same problem, but no solution. It’s pretty miserable.
Command-line interface
There is a command-line tool, SS.EXE, but it is almost totally unusable for scripting purposes. It has strange dependencies on the Visual SourceSafe client program, requires environment variables instead of accepting command-line arguments, and does very frustrating things that cannot be overriden easily. For example, the “get” command gets the file into the current directory even if you specify a subdirectory; in other words, the command ss Get dir/file.txt will get the file into the current directory, not dir. This is a shame, as this is the command I really want to use because it doesn’t work via the automation interface in VBScript.
Technorati Tags:No Tags
One of your links is dead http://msdn.microsoft.com/vstudio/previous/ssafe/using/articles/oleauto/
Yes, and Microsoft have apparently completely removed that page from MSDN. Well, fortunately archive.org has it, because it’s darned important information. Hey Microsoft, why don’t you quit deleting documentation?
I’ll fix the link in the article.
I was looking for the same Visual SourceSafe 6.0 Automation and I cold not find it on the Microsoft web site either. This is really annoying. There are so many articles related to SourceSafe and VB6 development that has been removed and the suggestion Xaprb made for finding it on the archive.org web site failed for me again.
Is there anywhere on the web where I can find any documentationon the VSS API for VB6? Please help.
I don’t know. I guess they are just “deprecating” older versions of stuff because they feel the need to sell the newer version instead. All hail the almighty dollar.
Point KamiT at :
http://web.archive.org/web/20060102021023/http://msdn.microsoft.com/library/en-us/dnvss/html/vssauto.asp
Link ok at 1250 GMT 19/04/07