TBlobSteam write problem
Hello,
I am attempting to write data to a blob field. The following shows the code
segment
try
with Fes do begin
Fes.insert;
FesNumber.AsInteger := 999;
FesOwner.Asinteger := 0;
Feed.Name := Edit3.text; // Feed is binary record, Name is string
within Feed
// Feed has been successfully
retrieved from from
// TBlobStream with a "read"
statement
DataStream :=
TBlobStream.Create(TBlobField(FeS.FieldByName('Dat a')),bmReadWrite);
DataStream.position := 0;
DataStream.Write(header,sizeof(header));
DataStream.seek(16,soFromBeginning); // offset from beginning of
blob field
case FesOwner.AsInteger of
0 : begin
DataStream.Write(feed,sizeof(feed));
end;
(* --- *)
end;
end;
finally
DataStream.free;
if Fes.state in [dsInsert,dsEdit] then
Fes.post;
end;
The Header information writes to the blob field. When the blob fields is
re-read, the "feed" information is missing. I have tried numerous
variations on this process without success. There are no error messages.
I am having the same problem in both Delphi 5 and Delphi 2009.
Thanks for any suggestions
Gene Lyman
|