Data loss when Reading blob data through ADODB.RecordSet/ADO

Posted by lennart.wikstrom@agrando.se on 01-Mar-2017 08:14

I am reading data through Hybrid Data Pipeline with ODBC from an OpenEdge database using ADODB.RecordSet.
When the table contains a blob field I read the blob data with ADODB.Stream as in the code below.
After it is saved to file a major part (about 70%) of the blob data is missing, the missing part is in the start of the data.
Does anyone have any idea how to solve this?

ObjRecordSet:MoveFirst no-error.
do while ODBC-CURSOR < ODBC-RECCOUNT:
    ObjStream:Open(,,,,).
    ObjStream:Type = adTypeBinary.
    ObjStream:position = 0.
    ObjStream:Write(ObjRecordSet:Fields(1):Value).
    ObjStream:SetEOS().
    ObjStream:position = 0.
    ObjStream:SaveToFile(".\blob.blb",2).

    assign ODBC-CURSOR = ODBC-CURSOR + 1.
    ObjRecordSet:MoveNext no-error.
end.

All Replies

Posted by Rob Debbage on 15-Mar-2017 04:32

To wrap this thread up:

ABL example of writing BLOB data to disk using ADO.NET

knowledgebase.progress.com/.../ABL-example-of-writing-BLOB-data-to-disk-using-ADO-NET

This thread is closed