The cause must be looked for in lack of proper initialization of LongReadLen.
In reply to Re^2: Extracting binary data from mssql by bart in thread Extracting binary data from mssql by Anonymous Monk