CDO to ADO
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
CDO to ADO

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
Graham Wright
Guest





Posted: Sun Aug 28, 2005 12:58 am    Post subject: CDO to ADO Reply with quote

I have a CDO IMessage object which I use in an Exchange asyn event sink to
extract incomming attachments.
After I have done this I want to delete the mail message.
It seems to do this I need to call the DeleteRecord member on an ADO _Record
object.
How do I obtain this _Record object from the IMessage object

The IMessage object has been created by calling Open on its DataSource using
an ADODB.Connection

--
Graham Wright
grahamwright@msn.com

Back to top
Graham Wright
Guest





Posted: Sun Aug 28, 2005 4:58 pm    Post subject: Re: CDO to ADO Reply with quote

I have now solved this and I am posting the solution in case anybody else
has a similar problem.

I was looking for a way of using the IMessage object because I was
experiencing problems opening a Record object.
The problem was that the Connection used for the IMessage object needs to be
cast to an IDispatch when opening the Record object.

The below now works;

_RecordPtr pRecord;

pRecord.CreateInstance(__uuidof(Record));

pRecord->Open(_variant_t(sURLItem), _variant_t((IDispatch*)pConnection),
adModeReadWrite, adFailIfNotExists, adOpenSource, _bstr_t(""), _bstr_t(""));

pRecord->DeleteRecord( _bstr_t(sURLItem), false);

pRecord->Close();



--
Graham Wright

"Graham Wright" <grahamwright@msn.com> wrote in message
news:uIpU$a0qFHA.1132@TK2MSFTNGP10.phx.gbl...
Quote:
I have a CDO IMessage object which I use in an Exchange asyn event sink to
extract incomming attachments.
After I have done this I want to delete the mail message.
It seems to do this I need to call the DeleteRecord member on an ADO
_Record object.
How do I obtain this _Record object from the IMessage object

The IMessage object has been created by calling Open on its DataSource
using an ADODB.Connection

--
Graham Wright
grahamwright@msn.com
Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
Contact Us
New Topics Powered by phpBB