Board index » delphi » Problem Copying Blob Fields from one table to another ?

Problem Copying Blob Fields from one table to another ?

When I try to copy the contents of one blob field to another such:

Table1.FieldByName('BlobField').AsBlob :=
        Table2.TheTable.FieldByName('BlobField').AsBlob;

I get (Undeclared identifier: 'AsBlob' ) error when compiling.

Can anyone tell me how I copy a Blob field directly into another Blob field.

 

Re:Problem Copying Blob Fields from one table to another ?


Quote
"J Smooth" <zxsmo...@yahoo.co.uk> wrote in message

news:d9b48056.0207230217.10747aa7@posting.google.com...

Quote
> When I try to copy the contents of one blob field to another such:

> Table1.FieldByName('BlobField').AsBlob :=
>   Table2.TheTable.FieldByName('BlobField').AsBlob;

> I get (Undeclared identifier: 'AsBlob' ) error when compiling.

You might try

    tBlobField (Table1.FieldByName ('BlobField')).AsBlob :=
        tBlobField (TheTable.FieldByName ('BlobField')).AsBlob;

Although I tend to use tBlobStreams for this kind of stuff.

Re:Problem Copying Blob Fields from one table to another ?


Quote
J Smooth wrote:
> When I try to copy the contents of one blob field to another such:
> Table1.FieldByName('BlobField').AsBlob :=
>         Table2.TheTable.FieldByName('BlobField').AsBlob;
> I get (Undeclared identifier: 'AsBlob' ) error when compiling.
> Can anyone tell me how I copy a Blob field directly into another Blob field.

Look up AssignTo and Assign in the online help  (TBlobField.Assign).

Regards,
Aage J.

Re:Problem Copying Blob Fields from one table to another ?


I think this has to be done using a memorystream. Look up
TMemoryStream and savetostream/loadfromstream. [I think these are the
right terms]. Just create the stream object, use it, then destroy it
when done.

HTH,
Dan

On 23 Jul 2002 03:17:53 -0700, zxsmo...@yahoo.co.uk (J Smooth) wrote:

Quote
>When I try to copy the contents of one blob field to another such:

>Table1.FieldByName('BlobField').AsBlob :=
>    Table2.TheTable.FieldByName('BlobField').AsBlob;

>I get (Undeclared identifier: 'AsBlob' ) error when compiling.

>Can anyone tell me how I copy a Blob field directly into another Blob field.

Re:Problem Copying Blob Fields from one table to another ?


Use TBlobStream.  Look up the Borland example in your Delphi Help file:
  Delphi Object and Component Reference
  Create, CreateBlobStream, Edit example
Quote
J Smooth wrote:
> When I try to copy the contents of one blob field to another such:

> Table1.FieldByName('BlobField').AsBlob :=
>    Table2.TheTable.FieldByName('BlobField').AsBlob;

> I get (Undeclared identifier: 'AsBlob' ) error when compiling.

> Can anyone tell me how I copy a Blob field directly into another Blob field.

Other Threads