Blob vs MemoryBlock

I need to be able to take data from a RecordSet where a field is defined as BLOB
and park it in a MEMORYBLOCK to let the user edit it… and they MAY decide to NOT commit any changes

my code looks something like this (RS is the current recordset)

blobMemoryBlock=new MemoryBlock(0) // no idea what the size may be (heck it might be null)
blobMemoryBlock=fld.value  // ILLEGAL CAST EXCEPTION

That is a bit simplfied… as there is other processing for fields that are NOT BLOB…
and looking in the DEBUGGER, I see “data”

And when I say BLOB… it could be anything… text, graphics, a spreadsheet, a word document, who knows

and while we are at it… I’m going to need to put it BACK (using an SQL prepared statement, not the rs.edit and rs.update functions)

Seems NATIVEVALUE may get it OUT… but that is READONLY… so not sure how to put it back… what would I pass to the Prepared statement? :frowning:

I’ve always used rs.field().StringValue. It’s just a bag of bytes.

thought encoding would cause issues doing it that way… but seems it doesn’t… thanks