SQL OLE Automation, WEBDAV & Exchange

SQL OLE Automation, WEBDAV & Exchange

Post by Lawrence Orcha » Wed, 17 Apr 2002 16:33:39



Cant believe no one on this newsgroup has tried this. Really could do
with some guidance on this please, no one from MS feeling brave?

Best
Lawrence


> Anyone managed to get these 3 working together?

> I'm using SQL2000 Enterprise SP2 & Exchange 2000.

> I have seen numerous articles where people are using the sp_oa*** SPs
> to create mail etc using CDONTS etc. Also lots of VB examples of using
> WEBDAV to create mail. But none showing the steps involved for
> combining the two from SQL2000.

> I have got as far as creating a contact (actually an email with no
> properties set) in the correct location using the code below, but the
> property setting using xml parameter in the sp_oamethod 'send' causes
> it to fail with the error:

> 0x80040005 ODSOLE Extended Procedure Code Execution Exception:  5

> Any help / examples / URLs much appreciated, SQL follows:











> --INITIALISE



>    BEGIN





>    RETURN

>    END

> --CREATE


> 'DOMAIN\user', 'password'


>    BEGIN





>    RETURN

>    END


> 'Content-Type', 'text/xml'


>    BEGIN





>    RETURN

>    END


> '<?xml version=''1.0''?>
> <g:propertyupdate
> xmlns:g=''DAV:''
> xmlns:c=''urn:schemas:contacts:''
> xmlns:e=''http://schemas.microsoft.com/exchange/''
> xmlns:mapi=''http://schemas.microsoft.com/mapi/''
> xmlns:x=''xml:''
> xmlns:cal=''urn:schemas:calendar:''
> xmlns:mail=''urn:schemas:httpmail:''>
> <g:set>
> <g:prop>
> <g:contentclass>urn:content-classes:person</g:contentclass>
> <e:outlookmessageclass>IPM.Contact</e:outlookmessageclass>
> <c:givenName>John</c:givenName>
> <c:middlename>Jacob</c:middlename>
> <c:sn>Doe</c:sn>
> <c:cn>John J. Doe</c:cn>
> <mail:subject>John Doe</mail:subject>
> <c:fileas>Doe, John </c:fileas>
> <c:initials>JJD</c:initials>
> <c:nickname>Johnnie</c:nickname>
> <c:personaltitle>Mr.</c:personaltitle>
> <c:namesuffix>MCSD</c:namesuffix>
> <c:street>One Microsoft Way</c:street>
> <c:postofficebox>PO Box 12345</c:postofficebox>
> <c:l>Redmond</c:l>
> <c:st>WA</c:st>
> <c:postalcode>98052-6399</c:postalcode>
> <c:co>USA</c:co>
> </g:prop>
> </g:set>
> </g:propertyupdate>'



> --APPLY PROPERTY CHANGES

> causes 0x80040005 whether prepared reference or actual xml


>    BEGIN





>    RETURN

>    END