Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: Siegfried, help please


Message #1 by terlfr@c... on Fri, 14 Feb 2003 18:17:59
Hi Sig, I saw that you answered some questions in this list, and I know 
that you are ""bola de neve", so please just check for me ( if you could, 
of course ), if this behavior in CDO component really happens.

Thanks in advance,


Im having a problem, sometimes my scripts works, and sometimes it fail in 
the logon line.

My Configuration: 
My IIS and Exchange Servers are in diferent servers.
My virtual web site has basic authentication
My users have logon on local right.

Im using global.asa and instanciating CDO there. Here is: 

  Sub Session_OnStart
	
   Session.timeout = 5
   Session.LCID	= 4105
   Set Session("objRenderApp") = Server.CreateObject("AMHTML.Application")
   Set Session("objCdoSession") = Server.CreateObject("MAPI.Session")
	
  End Sub

  Sub Session_OnEnd
   Set Session("objCdoSession") = nothing
   Set Session("objRendderApp") = nothing
 End Sub

And thorough my asp page I manipulate its methods and properties as here:

 Set objRP = Session("objRenderApp")
 objRP.LoadConfiguration   
1,"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSExchangeWeb\Param
eters"
	strServer = objRP.ConfigParameter("Server")

	strLogonID = Request.ServerVariables("Logon_User")
	strMailbox = Right(strLogonID, Len(strLogonID) - InStr
(strLogonID, "\"))
	strProfileInfo = strServer + vbLF + strMailbox
	
	set objSession = Session("objCdoSession")
	objSession.Logon  "", "", False,True , 0, true , strProfileInfo

My strProfileInfo its ok. "ExchangeServer Mailbox"

I have to launch this application but I can let this like that, unstable.

If someone is having the same situation, please HELP 
Message #2 by "Siegfried Weber" <sweber@c...> on Fri, 14 Feb 2003 19:20:19 +0100
1. I don't see any code where you actually log off from the CDO 1.21
session but rather seeing you just tidy up the objects in session_onend
2.Although I have used it in the past too, it is not good practice to
store objects in IIS session/application variables. It will tear down
performance dramatically.

Also I remember doing some impersonation thing when using CDOHTML
Rendering which was required bit I don't recall why. Try to use some of
the old samples from http://www.cdolive.com/code.htm. They do have such
code included and used to work fairly well back when I used them in my
Exchange 5.5 dev days.

<Cheers:Siegfried runat=3D"server" />

Development Lead,

CDOLive LLC - The Microsoft Messaging and Collaboration Application
Experts
http://www.cdolive.com


> -----Original Message-----
> From: terlfr@c... [mailto:terlfr@c...]
> Sent: Friday, February 14, 2003 7:18 PM
> To: ASP CDO
> Subject: [asp_cdo] Siegfried, help please
>
>
> Hi Sig, I saw that you answered some questions in this list,
> and I know
> that you are ""bola de neve", so please just check for me (
> if you could,
> of course ), if this behavior in CDO component really happens.
>
> Thanks in advance,
>
>
> Im having a problem, sometimes my scripts works, and
> sometimes it fail in
> the logon line.
>
> My Configuration:
> My IIS and Exchange Servers are in diferent servers.
> My virtual web site has basic authentication
> My users have logon on local right.
>
> Im using global.asa and instanciating CDO there. Here is:
>
>   Sub Session_OnStart
> =09
>    Session.timeout =3D 5
>    Session.LCID	=3D 4105
>    Set Session("objRenderApp") =3D
> Server.CreateObject("AMHTML.Application")
>    Set Session("objCdoSession") =3D 
Server.CreateObject("MAPI.Session")
> =09
>   End Sub
>
>   Sub Session_OnEnd
>    Set Session("objCdoSession") =3D nothing
>    Set Session("objRendderApp") =3D nothing
>  End Sub
>
> And thorough my asp page I manipulate its methods and
> properties as here:
>
>  Set objRP =3D Session("objRenderApp")
>  objRP.LoadConfiguration  
> 1,"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSExch
> angeWeb\Param
> eters"
> 	strServer =3D objRP.ConfigParameter("Server")
>
> 	strLogonID =3D Request.ServerVariables("Logon_User")
> 	strMailbox =3D Right(strLogonID, Len(strLogonID) - InStr
> (strLogonID, "\"))
> 	strProfileInfo =3D strServer + vbLF + strMailbox
> =09
> 	set objSession =3D Session("objCdoSession")
> 	objSession.Logon  "", "", False,True , 0, true , strProfileInfo
>
> My strProfileInfo its ok. "ExchangeServer Mailbox"
>
> I have to launch this application but I can let this like
> that, unstable.
>
> If someone is having the same situation, please HELP
>

  Return to Index