Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automation: error getting version of file based on project-level label

Status
Not open for further replies.

pingeling

Programmer
May 12, 2005
2
BE
When I use VSS-OLE automation to get a version of a file based on a project-level label, I get the following error:

-2147166583
Version not found

I found an article on the MSDN-site (196197) on this item were they suggest to add an extra line (if Vss is version 5.0). We use VSS 6.0 and I don't get it working. Here's my VB6-code:





objVSSDatabase.Open strINIFile, strUserName, strPassword

Set objVSSProject = objVSSDatabase.VSSItem(XMLValueOfAttributeOnNode(objXMLProject_VSSDB, "ProjectLocation"), False)

For Each objVSSItem In objVSSProject.Items(True)vvvvvv

Set objVersions = objVSSItem.Versions

For Each objVersion In objVersions

If Len(objVersion.Label) > 0 Then
Set objVSSItemSpecific = Nothing
Set objVSSItemSpecific = objVSSItem.Version(objVersion.Label)

'following line is the extra line, suggested by the MSDN_Article, gives no difference wether I leave or remove it
Set objVSSItemSpecific = objVSSItemS8pecific.Version(objVSSItemSpecific.VersionNumber)
objVSSItemSpecific.Get "D:\VSS_TEST\" & objVSSItem.Name & objVersion.Date
End If

next objVersion

next objVSSItem


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top