Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Visual Source Safe
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01163758
Message ID:
01163793
Views:
15
Kevin,

It works pretty well.
* this code pins the current version of every file in a VSS project

* code based off KB article found at http://support.microsoft.com/support/kb/articles/Q258/1/46.asp&NoWebContent=1
* and http://www.michaelis.net/SourceSafe/Faq.htm#_Toc33748951
* and http://www.eps-software.com/download/whitepaper_extendingsourcesafe.pdf
* and http://msdn.microsoft.com/library/en-us/dnvss/html/vssauto.asp?frame=true

public loVSS

loVSS = createobject( "SourceSafe" )
loVSS.Open( "\\vss01\vss\srcsafe.ini", "", "" )

set step on
ltStart = datetime()

*PinProject( "$/X/Y/Z/Prod/" )
PinProject( "$/A/B/C/Test/" )

? "Done at", datetime(), " elapsed time:", datetime() - ltStart
return


function PinProject( lcProject )
local loProject, loItems, loItem, lnVersionNumber, loOldItem

lcProject = addbs( lcProject )

? datetime(), " now working on project:" + lcProject
? ""

loProject = loVSS.VSSItem( lcProject ) && sets current project
loItems = loProject.Items() && collection of items in this project

for each loItem in loItems
   do case
      case ( loItem.Type = 0 )
         * recurse into the subproject (folder)
         PinProject( lcProject + loItem.Name + "/" )

      case ( loItem.Type = 1 )
         * a file to process
         @ $,0 say loItem.Name + space(30)
         lnVersionNumber = loItem.VersionNumber
         loOldItem = loItem.Version( lnVersionNumber )
         loProject.Share( loOldItem, "", 0 )
   endcase
endfor
return
>Anyone have experience working with VSS in VFP through COM?
>
>I'd like to add files to VSS, check in/out, get latest, get file version
>info, ect.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform