Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Sharepoint CODE problem from ASP

  Asked By: Samir    Date: Dec 14    Category: Sharepoint    Views: 676

I am having problems calling Sharepoint objects from ASP. We can run the
code in VB easily but when I call from ASP the browser usually hangs. A
couple of times the code has run but 90% of the time the thing just sits
there with an hour glass. We had had the same problem on two separate
installs on different machines.

I am thinking there is a security issue involved or some cache needs to be
flushed somewhere. Do I have to turn off anon.access to the pages or set
some special security permissions on the page?



4 Answers Found

Answer #1    Answered By: Rajul Shah     Answered On: Dec 14

Even I am also facing the same problem. If u come across any solution please
let me know

Answer #2    Answered By: Karan Hosagrahara     Answered On: Dec 14

We have just tried turning off anon access  to the page  from IIS and it
worked fine. We then turned in back on (i.e. enable anonymous users) and it
still works. I do not understand why but it seems to be ok now. We are
calling our pages  from an IP as well. Let me know if you require further

Answer #3    Answered By: Elise Weber     Answered On: Dec 14

can you send the code????????????????????

Answer #4    Answered By: Alton Vance     Answered On: Dec 14

The code  we are using is in VB and we call  a DLL. I am sneding you some ASP
code we have that checks users to see if they are coordinators. Note that VB
code and asp  code differ in the object they call; in ASP you must refer to
the CDO object not the PKMCDO object. This code was hanging the machine
senseless as well (all out sharepoint  code was giving us problems  but never
locally). It seems to work with anon. access  disabled.
If you go to Microsoft, their advice is to turn  off anon. access in the
vroot dir. for your asp sharepoint pages, or turn it off for any pages
explicitly that has asp/cdo objects  in Sharepoint.

In the following code snippet, we create a folder object off the cdo object
knowledge folder. This is set to true if the username is found in the
collection of coordinators. Note, you cannot reference the collection
directly - you have to create a variable off the collection that becomes the
array for the collection.
The end result is a Boolean variable IsCoord that is true if the user is a
coordinator (false if not).


sServerURL = "http://" & strComputerName

sServerFolder = sServerURL & "/" & strFoldername & "/"

Set objFolder = CreateObject("CDO.KnowledgeFolder")
IsCoord = false

objFolder.DataSource.Open sServerFolder ', , adModeReadWrite

collection = objFolder.Coordinators
'REsponse.write "Number of Co-ordinators:" & uBound(collection) & "<BR>"
For i=0 to uBound(collection)

collection(i) = lcase(collection(i))
'RESPONSE.WRITE "<font color='red' size='1'>"
'RESPONSE.WRITE "Person(" & i & ") " & collection(i) & "<br>"
TempUserName = lcase(Session("Username"))

if instr(collection(i),TempUserName) > 0 then
IsCoord = True
exit for
end if

set objfolder= nothing


Didn't find what you were looking for? Find more on Sharepoint CODE problem from ASP Or get search suggestion and latest updates.