Microsoft KB Archive/239785

= PRB: CDO Fails in Windows NT Service or ASP Page with Outlook 97 Installed =

Article ID: 239785

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Outlook 97 Standard Edition
 * Microsoft Collaboration Data Objects 1.21
 * Microsoft Exchange Client 4.0
 * Microsoft Exchange Client 5.0

-



This article was previously published under Q239785



SYMPTOMS
A CDO 1.21 application running as a Windows NT service fails with the following error message during user logon if the computer has Microsoft Outlook 97 or any version of the Exchange client as the default mail client:

"Collaboration Data Objects - [MAPI_E_UNKNOWN_FLAGS(80040106)]"

NOTE: The application runs fine interactively.

CDO code that runs in an Active Server Pages (ASP) page under Internet Information Server (IIS) can also return the error MAPI_E_UNKNOWN_FLAGS because ASP pages effectively run as an NT service.



CAUSE
With Microsoft Exchange 5.5 SP2, CDO 1.21 adds a MAPI_NO_COINIT flag to MAPIInitialize (a call made to MAPI subsystem during user logon) whenever CDO 1.21 runs as a service application. Before the Microsoft Exchange 5.5 SP2 builds of MAPI, such as the one that comes with Microsoft Outlook 97, this flag was not recognized and returned the MAPI_E_UNKNOWN_FLAGS flag.

CDO 1.21 does not ship with Outlook 97 or the Exchange clients. It must be obtained and installed separately. See the "References" section of this article for more information.



RESOLUTION
Remove or rename the CDO.dll and upgrade to Outlook 98 or Outlook 2000, or install the MAPI subsystem that ships with Windows 2000. This last option is not suited for Windows 9x systems.



Steps to Reproduce Behavior
 On a computer that only has Microsoft Outlook 97 installed, install CDO, which can be acquired from:

171440 INFO: Where to Acquire the Collaboration Data Objects Libraries.

 To create a VB project which runs as a service and logs on to a Mailbox using CDO folllow the instructions in the following article:

177851 HOWTO: Build a VB/Messaging Application to Run from a Service

 Run your service. The following error will appear:

"Collaboration Data Objects - [MAPI_E_UNKNOWN_FLAGS(80040106)]".



