Help and Support

Article ID: 179104 - Last Review: May 9, 2005 - Revision: 3.0

PRB: Access Denied Using CDO (1.x) from VBScript

This article was previously published under Q179104

On This Page

Expand all | Collapse all

SYMPTOMS

You may receive the error "Access Denied" trying to invoke certain properties of Collaboration Data Objects (1.1, 1.2, 1.21) objects from VBScript (VBS) when the same operation succeeds from a Visual Basic application.

STATUS

This behavior is by design to ensure the security of message stores and address books.

MORE INFORMATION

Steps to Reproduce Behavior

   'Following is the VBScript code to reproduce the behavior:
   'This sample assumes that the CDO (1.1, 1.2, 1.21) library is installed
   'on the test system and that a profile named "Microsoft Outlook"
   'exists.

   Sub but_OnClick
     Dim objSession
     Set objSession = CreateObject("mapi.session")
     objSession.Logon "Microsoft Outlook"
     MsgBox objSession.Inbox.Messages.Count 'This fails w/Access Denied
     objSession.Logoff
   End Sub
				
NOTE: This issue does not occur with all properties and methods; some operations (like sending messages) and some properties operate as expected.

REFERENCES

For information on where to acquire the most recent version of the CDO (1.x) Libraries, please see the following article in the Microsoft Knowledge Base:
171440  (http://support.microsoft.com/kb/171440/EN-US/ ) INFO: Where to Acquire the Collaboration Data Objects Libraries

APPLIES TO
  • Microsoft Collaboration Data Objects 1.1
  • Microsoft Collaboration Data Objects 1.2
  • Microsoft Collaboration Data Objects 1.21
Keywords: 
kberrmsg kbmsg kbprb KB179104
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Article Translations