Unable to create SourceSafe Object<P>I'm currently using VSS2005. I did register ssapi.dll by "regsvr32 ssapi.dll"; however, I got error: "could not create object named "SourceSafe" from vbscript below. Please help.</P><FONT color=#0000ff size=2> <P>Set</FONT><FONT size=2> oVSSDatabase = WScript.CreateObject(</FONT><FONT color=#800000 size=2>"SourceSafe"</FONT><FONT size=2>) </P> <P>oVSSDatabase.Open (</FONT><FONT color=#800000 size=2>"C:\VSSData\srcsafe.ini"</FONT><FONT size=2>) </P></FONT><FONT color=#0000ff size=2> <P>Set</FONT><FONT size=2> oVSSItem = oVSSDatabase.VSSItem(</FONT><FONT color=#800000 size=2>"$/Test/testingfile.cs"</FONT><FONT size=2>) </P> <P>oVSSItem.Parent.LocalSpec = </FONT><FONT color=#800000 size=2>"C:\Projects"</FONT><FONT size=2> </P> <P>oVSSItem.Get</P></FONT>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Zd87512d5-b737-4e33-844c-0ec49b4e90cahttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#d87512d5-b737-4e33-844c-0ec49b4e90cahttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#d87512d5-b737-4e33-844c-0ec49b4e90caAndyPhamhttp://social.msdn.microsoft.com/Profile/en-US/?user=AndyPhamUnable to create SourceSafe Object<P>I'm currently using VSS2005. I did register ssapi.dll by "regsvr32 ssapi.dll"; however, I got error: "could not create object named "SourceSafe" from vbscript below. Please help.</P><FONT color=#0000ff size=2> <P>Set</FONT><FONT size=2> oVSSDatabase = WScript.CreateObject(</FONT><FONT color=#800000 size=2>"SourceSafe"</FONT><FONT size=2>) </P> <P>oVSSDatabase.Open (</FONT><FONT color=#800000 size=2>"C:\VSSData\srcsafe.ini"</FONT><FONT size=2>) </P></FONT><FONT color=#0000ff size=2> <P>Set</FONT><FONT size=2> oVSSItem = oVSSDatabase.VSSItem(</FONT><FONT color=#800000 size=2>"$/Test/testingfile.cs"</FONT><FONT size=2>) </P> <P>oVSSItem.Parent.LocalSpec = </FONT><FONT color=#800000 size=2>"C:\Projects"</FONT><FONT size=2> </P> <P>oVSSItem.Get</P></FONT>Sat, 05 Aug 2006 04:34:35 Z2006-08-07T18:42:26Zhttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#a31ea950-48c1-4571-b604-864a50a85bbehttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#a31ea950-48c1-4571-b604-864a50a85bbeAlin Constantinhttp://social.msdn.microsoft.com/Profile/en-US/?user=Alin%20ConstantinUnable to create SourceSafe Object<p>Do you get any other error code that may help pinpoint the problem?</p> <p>You may need to look in registry at the following key HKEY_CLASSES_ROOT\SourceSafe. If you're working with VSS 2005, it should look like this:</p> <p>   [HKEY_CLASSES_ROOT\SourceSafe]<br>   @=&quot;Microsoft Visual SourceSafe Automation&quot;<br>   [HKEY_CLASSES_ROOT\SourceSafe\CLSID]<br>   @=&quot;{783CD4E4-9D54-11CF-B8EE-00608CC9A71F}&quot;<br>   [HKEY_CLASSES_ROOT\SourceSafe\CurVer]<br>   @=&quot;SourceSafe.8.0&quot;</p> <p>You can also try creating directly the VSS 2005 automation object:</p> <p>   Set<font size=2> oVSSDatabase = WScript.CreateObject(</font><font color="#800000" size=2>&quot;SourceSafe.8.0&quot;</font><font size=2>) </font><br></p> <p>Alin</p>Mon, 07 Aug 2006 01:27:09 Z2006-08-07T18:42:26Zhttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#b8ea5ce0-6076-463a-b643-f3ab4a1548d5http://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#b8ea5ce0-6076-463a-b643-f3ab4a1548d5AndyPhamhttp://social.msdn.microsoft.com/Profile/en-US/?user=AndyPhamUnable to create SourceSafe Object<p>Thanks it works.</p> <p>Could you please point me to some resources that have sample vbscript? </p>Mon, 07 Aug 2006 18:43:51 Z2006-08-07T18:43:51Zhttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#c838a009-1aa6-4602-b8fa-1c2ed36d786bhttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#c838a009-1aa6-4602-b8fa-1c2ed36d786bAlin Constantinhttp://social.msdn.microsoft.com/Profile/en-US/?user=Alin%20ConstantinUnable to create SourceSafe Object<p>I don't know of any samples that use VSS/vbScript, but I don't think that using VSS from VB should be much different from VBScript.</p> <p>I'd probably take a closer look at IVSS interface functions (<a title="http://msdn2.microsoft.com/en-us/library/microsoft.visualstudio.sourcesafe.interop.aspx" href="http://msdn2.microsoft.com/en-us/library/microsoft.visualstudio.sourcesafe.interop.aspx">http://msdn2.microsoft.com/en-us/library/microsoft.visualstudio.sourcesafe.interop.aspx</a>) and at VB automation sample (<a title="http://www.microsoft.com/downloads/details.aspx?FamilyID=1efdb5a1-317c-49b3-82f3-ed2f70481cca&amp;DisplayLang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1efdb5a1-317c-49b3-82f3-ed2f70481cca&amp;DisplayLang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=1efdb5a1-317c-49b3-82f3-ed2f70481cca&amp;DisplayLang=en</a>)</p> <p>Alin</p>Mon, 07 Aug 2006 19:01:47 Z2006-08-07T19:01:47Zhttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#9692ce50-41f4-4086-84c8-0975afa6ef1fhttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#9692ce50-41f4-4086-84c8-0975afa6ef1fAndyPhamhttp://social.msdn.microsoft.com/Profile/en-US/?user=AndyPhamUnable to create SourceSafe Object<p>Alin,</p> <p>Thanks, I got my script working; however, I search for entire document on msdn. I can't find and return code for VSSItem</p>Tue, 08 Aug 2006 21:17:22 Z2006-08-08T21:17:22Zhttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#34a17108-974e-49c1-abea-c8ad629bf9f1http://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#34a17108-974e-49c1-abea-c8ad629bf9f1Alin Constantinhttp://social.msdn.microsoft.com/Profile/en-US/?user=Alin%20ConstantinUnable to create SourceSafe Object<p>VssItem is an object. Are you talking about return code from VssItem.Get function?</p> <p>Get() doesn't have any return code - it gets the file locally if the local file doesn't exist or if it's different than database's version. If you need to know beforehand if Get will do anything you'll have to call IVssItem.IsDifferent, or File.Exist (whatever is its equivalent in VBScript)</p> <p>Alin</p>Tue, 08 Aug 2006 23:24:50 Z2006-08-08T23:24:50Zhttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#4769fc56-aac7-4f0c-9aa4-36021471ef3ehttp://social.msdn.microsoft.com/Forums/en-US/vssourcecontrol/thread/d87512d5-b737-4e33-844c-0ec49b4e90ca#4769fc56-aac7-4f0c-9aa4-36021471ef3eAndyPhamhttp://social.msdn.microsoft.com/Profile/en-US/?user=AndyPhamUnable to create SourceSafe ObjectGot it thanksWed, 09 Aug 2006 15:33:21 Z2006-08-09T15:33:21Z