Board index » delphi » Assigning value to binary field. PLEASE HELP

Assigning value to binary field. PLEASE HELP

How do I assign an array [ 1..1000] of byte to a binary field ?

Thanks in advance

 

Re:Assigning value to binary field. PLEASE HELP


You'll need to use a TBlobStream.  A quick example:

var
  X: array[1..1000] of Byte;
  S: TBlobStream;

begin
  Table1.Edit;
  S := TBlobStream.Create(Table1BinaryField,bmReadWrite);
  try
    S.Truncate; { wipeout existing data in the field }
    S.Write(X,sizeof(X));
  finally
    S.Free;
  end;
  Table1.Post;
end;

Birger Hansen <bhan...@inet.uni-c.dk> wrote in article
<329e1786.1792...@news.uni-c.dk>...

Quote
> How do I assign an array [ 1..1000] of byte to a binary field ?

Other Threads