Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Putting Object into BLOB field
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01423962
Message ID:
01423987
Views:
51
This message has been marked as a message which has helped to the initial question of the thread.
The GetDecodedContentStream() method returns an object and VFP doesn't have a built-in way to persist an object.
Try
		loStream = loAttachment.GetDecodedContentStream()
		lwStream = loStream.Read()
		INSERT INTO Attachments (iTimeId, wAttachmnt) VALUES (lnTimeId, lwStream)
BTW, why not store just attachment itself?

>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
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform