OCX IStream object into a blob field

Basically I have created an OCX Control that has two functions: (I used the symbol menu to get these definitions) [BOOL SetBGImageStr :=] MyOCX.SetBGImageStr(VAR ISTREAM JPGStream) [ISTREAM GetBGImageStr :=] MyOCX.GetBGImageStr() GetBGImageStr reurns an IStream object which I want to save to a blob field. SetBGImageStr would be used to pass the contents of the blob back to the OCX. This way I can have an external viewer for the data, but still store it in Navision Attain. I can change GetBGImageStr to look the same as SetBGImageStr if that would make the implementation easier in Attain. My problem is this: How do I get the IStream object into the blob field? I have been searching on the web, and through all of the documentation that I have, and could find only two examples of how to use an instream or an outstream. The one example makes use of XMLDom, and does not work, the other makes use of a file and only writes text to the file. Could anyone help me to solve this either by giving me an example, pointing me in the right direction to figure out how to do this? The whole thing can be done by making use of a temporary file, but I would prefer not to. Any help will be greatly appreciated.

You should use blob.CreateInstream func. Something like: //read blob rec.CalcFields(BlobField); rec.BlobField.CreateInStream(Instream); Instream.READ(var); //write to blob rec.BlobField.CreateOutStream(Instream); Instream.write(var); rec.modify;