getWorkspaces Call Does Not Work Properly with a Null Password (309572)
The information in this article applies to:
- Microsoft SharePoint Portal Server 2001
This article was previously published under Q309572 SYMPTOMS
When you are using SharePoint Portal Server, you may want to see what workspaces a particular user has access to. The following code attempts to do this:
Dim Server As New PKMCDO.KnowledgeServer
Dim Record As ADODB.Recordset
Server.PromptToAuthenticate = False
Server.DataSource.Open txtServerURL.Text, , , , , txtUser.Text, txtPassword.Text
Set Record = Server.Workspaces
While Rec.EOF = False
ListBox.AddItem rec.Fields("Dav:href")
Record.MoveNext
Wend
ListBox.AddItem ""
Set Record = Nothing
Set server = Nothing
If all of the user credentials are correct, this method works correctly. If, however, txtPassword.Text is left empty, this method uses the credentials of the currently logged-on user who is running the application. This causes a problem when you are trying to obtain the workspaces for a user whose password is blank, because in such a scenario, txtPassword.Text will be empty, and the method will not return that user's workspaces.
CAUSE
When the getWorkspaces function makes the call to the server, the InternetSetOption API is used to set the credentials. When there is a null password, SharePoint Portal Server does not call InternetSetOption correctly, and reverts to using the currently logged-on user.
WORKAROUND
When you are trying to obtain the workspaces that a user has access to, always choose users who do not have a blank password.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 12/31/2002 |
---|
Keywords: | kbbug kbSharePtPortalSvr2001sp1fix KB309572 |
---|
|