2008年7月31日星期四

vss--automation-ole---snapshot




How to use the Visual SourceSafe automation interface

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:

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

You might also like:

  1. How to create a VB6 console program
  2. How to avoid VBScript regular expression gotchas
  3. How to exploit an insecure order of access to resources
  4. How to flatten hierarchies with awk
  5. Three updated tools in MySQL Toolkit

5 Responses to “How to use the Visual SourceSafe automation interface”


  1. 1 pruiser
  2. 2 Xaprb

    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.

  3. 3 KamiT

    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.

  4. 4 Xaprb

    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.

  5. 5 TheLurker

没有评论: