Subject | RE: [IBO] Help with Blobs required. |
---|---|
Author | Adrian Wreyford |
Post date | 2006-11-28T19:59:10Z |
OK I figured it ..
Var
PhotoStream : TmemoryStream;
.
PhotoStream := TmemoryStream.Create;
IB_QueryNewTable.Insert;
IB_QueryOldTable.FieldByName('OldPhoto').AsignTo(PhotoStream);
IB_QueryNewTable.FieldByName('Photo').Asign(PhotoStream);
IB_QueryNewTable.Post;
PhotoStream.Free;
This copies the blobs between the two tables without corrupting the data!
Hope this can help someone else.
Adrian
_____
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Adrian Wreyford
Sent: 28 November 2006 08:56 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] Help with Blobs required.
Hi,
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
Regards
Adrian
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
Var
PhotoStream : TmemoryStream;
.
PhotoStream := TmemoryStream.Create;
IB_QueryNewTable.Insert;
IB_QueryOldTable.FieldByName('OldPhoto').AsignTo(PhotoStream);
IB_QueryNewTable.FieldByName('Photo').Asign(PhotoStream);
IB_QueryNewTable.Post;
PhotoStream.Free;
This copies the blobs between the two tables without corrupting the data!
Hope this can help someone else.
Adrian
_____
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Adrian Wreyford
Sent: 28 November 2006 08:56 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] Help with Blobs required.
Hi,
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
Regards
Adrian
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]