PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Form Programming CDO Access hangs outlook

Reply

CDO Access hangs outlook

 
Thread Tools Rate Thread
Old 07-09-2004, 03:51 PM   #1
Hoppers
Guest
 
Posts: n/a
Default CDO Access hangs outlook


I have been using the below code to access information via CDO. All
works fine on my outlook and many other users, however there are some
users that when they open my form their Outlook hangs.

A seperate Outlook process appears in task manager and it doesn't
matter how long i leave it the code never continues.
If the process is killed the CDO access returns a VBSript error.

"Error in lonon: - 2147024891
Collaberation Data Objects - E_Accessdenied(80070005)"

Can anyone help with any suggestions.

I'm not a developer and i'm quiet new to outlook coding so i would be
grateful for simplistic answers.

Thanks

Outlook version = 2002 sp2
Exchange 5.5

******************************************************************************
Function OpenMapiSession()
on error resume next
'Start the CDO code to find a match.
Set cdoSession = CreateObject("Mapi.session")
cdoSession.Logon ,,false,false,0 'Use the existing Outlook session.
if err.number <> 0 then msgbox "ERROR in logon: " & err.number &
vbCRLF & err.description
Set cdoAddrEntry = cdoSession.CurrentUser
if err.number <> 0 then msgbox "ERROR in logon: " & err.number &
vbCRLF & err.description
'Get data from Session.CurrentUser.
MapiSession = 1
PresentUser = cdoAddrEntry.fields(cdo_FirstName) & " " &
cdoAddrEntry.fields(cdo_Surname)
UserTelNumber = cdoAddrEntry.fields(cdoPR_Business_Telephone_Number)
RequestersDisplayName = cdoAddrEntry.fields(CdoPR_DISPLAY_NAME)
Item.UserProperties.find("ImplementerName").value = PresentUser
End Function
******************************************************************************
  Reply With Quote
Old 10-09-2004, 02:32 PM   #2
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: CDO Access hangs outlook

Have you checked to see whether CDO is indeed installed on these machines?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Hoppers" <peter.hopkin@abbey.com> wrote in message
news:28f0c171.0409070651.7c23f60e@posting.google.com...
>I have been using the below code to access information via CDO. All
> works fine on my outlook and many other users, however there are some
> users that when they open my form their Outlook hangs.
>
> A seperate Outlook process appears in task manager and it doesn't
> matter how long i leave it the code never continues.
> If the process is killed the CDO access returns a VBSript error.
>
> "Error in lonon: - 2147024891
> Collaberation Data Objects - E_Accessdenied(80070005)"
>
> Can anyone help with any suggestions.
>
> I'm not a developer and i'm quiet new to outlook coding so i would be
> grateful for simplistic answers.
>
> Thanks
>
> Outlook version = 2002 sp2
> Exchange 5.5
>
> ******************************************************************************
> Function OpenMapiSession()
> on error resume next
> 'Start the CDO code to find a match.
> Set cdoSession = CreateObject("Mapi.session")
> cdoSession.Logon ,,false,false,0 'Use the existing Outlook session.
> if err.number <> 0 then msgbox "ERROR in logon: " & err.number &
> vbCRLF & err.description
> Set cdoAddrEntry = cdoSession.CurrentUser
> if err.number <> 0 then msgbox "ERROR in logon: " & err.number &
> vbCRLF & err.description
> 'Get data from Session.CurrentUser.
> MapiSession = 1
> PresentUser = cdoAddrEntry.fields(cdo_FirstName) & " " &
> cdoAddrEntry.fields(cdo_Surname)
> UserTelNumber = cdoAddrEntry.fields(cdoPR_Business_Telephone_Number)
> RequestersDisplayName = cdoAddrEntry.fields(CdoPR_DISPLAY_NAME)
> Item.UserProperties.find("ImplementerName").value = PresentUser
> End Function
> ******************************************************************************



  Reply With Quote
Old 26-10-2004, 08:36 PM   #3
rg
Guest
 
Posts: n/a
Default Re: CDO Access hangs outlook

Hello,

Two Outlook 2003 users at my company are having the same problem.

My code is similar (if not exactly the same--it is from a book example).

Set oCDOSession = application.CreateObject("MAPI.Session")

oCDOSession.Logon "", "", False, False, 0

http://support.microsoft.com/?kbid=177630 sounded like it might be the
problem, but

changing the Logon to

oCDOSession.Logon "", "", False, False, 0, True

did not fix the problem (although it still works on my computer).

I did check to make sure that the CDO component of Outlook 2003 was
installed (via the MS Office 2003 Install).

I have the appcompat.txt that MS created because of the error.

Any help is greatly appreciated. I haven't found any other possible
solutions by Googling yet.

Thank you,

Roy

"Hoppers" <peter.hopkin@abbey.com> wrote in message
news:28f0c171.0409070651.7c23f60e@posting.google.com...
> I have been using the below code to access information via CDO. All
> works fine on my outlook and many other users, however there are some
> users that when they open my form their Outlook hangs.
>
> A seperate Outlook process appears in task manager and it doesn't
> matter how long i leave it the code never continues.
> If the process is killed the CDO access returns a VBSript error.
>
> "Error in lonon: - 2147024891
> Collaberation Data Objects - E_Accessdenied(80070005)"
>
> Can anyone help with any suggestions.
>
> I'm not a developer and i'm quiet new to outlook coding so i would be
> grateful for simplistic answers.
>
> Thanks
>
> Outlook version = 2002 sp2
> Exchange 5.5
>
>

****************************************************************************
**
> Function OpenMapiSession()
> on error resume next
> 'Start the CDO code to find a match.
> Set cdoSession = CreateObject("Mapi.session")
> cdoSession.Logon ,,false,false,0 'Use the existing Outlook session.
> if err.number <> 0 then msgbox "ERROR in logon: " & err.number &
> vbCRLF & err.description
> Set cdoAddrEntry = cdoSession.CurrentUser
> if err.number <> 0 then msgbox "ERROR in logon: " & err.number &
> vbCRLF & err.description
> 'Get data from Session.CurrentUser.
> MapiSession = 1
> PresentUser = cdoAddrEntry.fields(cdo_FirstName) & " " &
> cdoAddrEntry.fields(cdo_Surname)
> UserTelNumber = cdoAddrEntry.fields(cdoPR_Business_Telephone_Number)
> RequestersDisplayName = cdoAddrEntry.fields(CdoPR_DISPLAY_NAME)
> Item.UserProperties.find("ImplementerName").value = PresentUser
> End Function
>

****************************************************************************
**


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off