unable to run vss.open()

  • Thread starter Thread starter stan.kolker
  • Start date Start date
S

stan.kolker

HI,

I am just trying to open vss:

try

SourceSafeTypeLib.IVSSDatabase vssDb = new VSSDatabaseClass();

vssDb.Open(@"C:\Program Files\Microsoft Visual
Studio\Common\VSS\srcsafe.ini","admin","");

catch()

//returns

Access to file "C:\Program Files\Microsoft Visual
Studio\Common\VSS\data\rights.dat" denied



how does it get that path? if I am trying to access a diffrent path..



Thank you,
 
The srcsafe.ini file specifies where the database lives, and it appears that
it was pointing to the rights.dat file. This could also be that you are not
suppling a password for the user admin. Perhaps there is a password for
that database, or admin is not a valid user for that database?
 
I added a new user with a password. and it still goes to that
directory instead of where I am trying pointing to. :(
any other ideas?
 
it finds the right user, because when I try to access with a different
user that does not exists in VSS. it gives an error :"user not found "
 
This seems to work for me

Dim objSS As SourceSafeTypeLib.IVSSDatabase


Try
objSS = New SourceSafeTypeLib.VSSDatabaseClass
objSS.Open("\\myserver\mysourcesafeshare\srcsafe.ini", "myusername",
"")

For Each item As SourceSafeTypeLib.VSSItem In
objSS.VSSItem(0).Items(False)
Debug.Print(item.Name)
Next

Catch ex As Exception
Debug.Print(ex.ToString)
End Try


Perhaps you are specifying the wrong sourcesafe database ini? Of course, I
had to actually code this to test it, there didn't seem to be a way to close
the connection, is there a way to close the connection or have I just hosed
my sourcesafe database. I have backups so i am not worried too much.
 
Hi AMDRIT,

Vss will close the connection by iteself.

Do you think maybe the problem that I am running VS.NET 2003 with VSS
2005. Maybe this is why it is not working?

Thanks,
 
stan,

I am using VSS interop here with no problems at all. My main class looks
like this:

VSSDatabaseClass VSSdb = new VSSDatabaseClass();
VSSdb.Open(_VSSFolder, _Username, _Password);
VSSItem vssProj = VSSdb.get_VSSItem("$/", false);
IVSSItems items = vssProj.get_Items(false);

My _VSSfolder variable points to the srcsafe.ini path, for example:
"C:\\MySS\srcsafe.ini"

Try remove and add the interop dll from your application.

Make sure your application has access to this folder.
 
Thanks for your help and your script example.

I was actually doing the same thing..
I found the answer but I am not sure what it means:

I went to Visual source safe administarator and Edit my user account :
I checked "Read only" and it works fine..

Does anyone know why it works like this? what does read only means?
would I be able to checkin/checkout the files?

Thank you,
 
Back
Top