>As part of an SMTP event sink I am trying to INSERT an object (attachment) into a BLOB field in a table. Unfortunately this does not work and cause a Data Type Mismatch.
>
>
>CREATE TABLE MyAttachments FREE (iTimeId I, cFileName C (50), cContType C(50), wAttachmnt W)
>
>PROCEDURE ISMTPOnArrival_OnArrival(toMsg AS VARIANT, tnEventStatus AS VARIANT @) AS VOID
> lnTimeId = 123456
> FOR EACH loAttachment in toMsg.Attachments
> INSERT INTO Attachments
> (iTimeId, wAttachmnt) VALUES (lnTimeId, loAttachment.GetDecodedContentStream())
> ENDFOR
>
>
>Any guesses where I might be going wrong?
>
>Thanks,
> Nick
Did you try to examine what does GetDecodedContentStream() return?
Say,
oStream = loAttachment.GetDecodedContentStream()
cText = oStream.ReadText()
If it's not broken, fix it until it is.
My Blog