Subject RE: [IBO] Help with Blobs required.
Author Jason Wharton
> I have a table with a blob field in it, that I have used to store jpeg
> photos.
>
> I can save, and delete these jpegs no problem.
>
> I have decided to move the field from the current table
> to a new table in the database.
>
>
>
> I then copy the blob fields contents to the new
> blob field in the new table, and insert a new record.
>
> I set the datasource property of the IB_JPEGImage,
> and then when setting the datafield property to point
> to the blob field in the new table, I get Jpeg
> error #41.
>
> I suspect that the data in the blob has been corrupted
> when transferring between the two tables.
>
> The fields are both BLOB, SUBTYPE 0 SEGMENT SIZE 80.
>
> I copy the blobs over as follows..
>
> ,,,
>
> IB_QueryNewTable.Insert;
>
> IB_QueryNewTable.FieldByName('Photo').Value :=
> IB_QueryOldTable.FieldByName('OldPhoto').Value;
>
> IB_QueryNewTable.Post;
>
> I can see that there is data in the Blob, but suspect it is corrupted.
>
> Should I use .AsString, but will this be large enough to say
> handle a 6mb
> photo?
>
> IBO4_7Beta8, FB2.0 D6

Use the Assign() mechanism to transfer the blob data.

IB_QueryNewTable.FieldByName('Photo').Assign(
IB_QueryOldTable.FieldByName('OldPhoto'));

HTH,
Jason