views:

76

answers:

1

I often need to make a manifest of files with Microsoft Visual Source Safe version numbers on them. Is there a way to get a list of files with version numbers in a project?

+1  A: 

You can use automation, VSS 6.0 (and earlier) came with an ActiveX dll you can use. Reference Microsoft SourceSafe 6.0 Type Library in your project, and something like (un proven and untested VB code below) should work for you.

The Automation is very powerful, I once used it to proved Vss integration into an Ide I once built where business type folk wrote XQuery snippets to query Xml messages.

Private Sub GetAllVersionNumbers()
    Dim db As New VSSDatabase
    Call db.Open("\\codestore\myProject\srcsafe.ini", "Myuser", "password")

    Call GetItemVersion(db.CurrentProject)
End Sub

Private Sub GetItemVersion(ByVal root As VSSItem)
    Dim item As VSSItem

    For Each item In root
        If item.Type = VSSITEM_FILE Then
            Call Output(item.Name, item.VersionNumber)
        Else ' item.Type =VSSITEM_FDOLDER
            'recurse
            Call GetItemVersion(item)
        End If
    Next
End Sub
Binary Worrier