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
-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