Article ID: 321039 - Last Review: August 25, 2005 - Revision: 5.3
PRB: "80040E94" or "80040E09" Error Message When You Use the IDataSource.Save Method After You Install Exchange 2000 SP2
This article was previously published under Q321039
On This Page
SYMPTOMS
If you use the IDataSource.Save method after you install Exchange 2000 Server Service Pack 2 (SP2), you may receive one of the following error messages:
80040E94: Caller requested write access to a read-only object
-or-
80040E09: Permission Denied
CAUSE
This behavior occurs because of a change in the implementation of the IDataSource.Open method in the CDO for Exchange 2000 (CDOEX) Library. By default, the Open method opens access to an object as adModeReadWrite in versions of Exchange Server earlier than Exchange 2000 Server SP2. However, in Exchange 2000 Server SP2, the Open method opens access to an object as adModeRead by default.
RESOLUTION
Call IDataSource.Open with the adModeReadWrite parameter before you call the IDataSource.Save method, as follows:
oObject.DataSource.Open strSourceURL, , adModeReadWrite
STATUS
This behavior is by design.
MORE INFORMATION
Code Samples to Reproduce the Problem
CDO for Exchange 2000 (CDOEX) Sample
' CDOEX.vbs
' error 800040E09: Permission Denied.
Const adFailIfNotExists = -1
Const adModeReadWrite = 3
Dim strUrl
Dim objMessage
strUrl = "file://./backofficestorage/<your domain>/MBX/<your alias>"
Set objMessage = CreateObject("CDO.Message")
With objMessage
.DataSource.Open strUrl & "/<your folder>/<message subject>.eml", , , adFailIfNotExists
'.DataSource.Open strUrl & "/<your folder>/<message subject>.eml", , adModeReadWrite, adFailIfNotExists
.Subject = "<new subject>"
.DataSource.Save
End With
Set objMessage = Nothing
Msgbox "Done"
CDO for Exchange Management (CDOEXM) Sample
' CDOEXM.vbs
' error 80040E94: Caller requested write access to a read-only object.
Const adModeReadWrite = 3
Dim objPerson
Dim objMailRecip
Dim strURL
strURL = "LDAP://<Server>/CN=<username>,CN=Users,DC=<domain>,DC=com"
Set objPerson = CreateObject("CDO.Person")
objPerson.Datasource.Open strURL
'objPerson.Datasource.Open strURL, , adModeReadWrite
Set objMailRecip = objPerson.GetInterface("IMailRecipient")
objPerson.DataSource.Save
Set objPerson = Nothing
Set objMailRecip = Nothing
Msgbox "Done"
Note: This article is from Microsoft Knowledage Base
Related problems posted by other users | |
| more... |

