Board index » delphi » TMemoField BUG!!!???

TMemoField BUG!!!???

Damned if nothing ever works the way it does in the {*word*30}ing online
help! After fidgiting with this problem for 3 days, I've come to the
conclusion that this feature must not be implemeted!

procedure TForm1.Button1Click(Sender: TObject);
var
  Buffer: PChar;
  Size: Word;
  IsTrue: Boolean;

begin

  try
  begin
    Size := Table1Notes.DataSize;      
    GetMem(Buffer, Size);          
    IsTrue := Table1Notes.GetData(Buffer);  
  end;

(* Size is always 0! Yes my table is active and yes Table1Notes is an
instance of TMemoField. If I force size to be 5000 then run through
IsTrue gets set to true, i.e. there is data to recieve, but I get a
EDBEngineError: Process not applicable! What? No mention of this error
in the Online Help? Of course not. Why doesn't it work? Am I missing
something or is this another Bug? *)

  finally
  begin
    FreeMem(Buffer, Size);          {Frees memory allocated to Buffer}
    MyStrings.Free;
  end;

  end;
end;

 

Re:TMemoField BUG!!!???


Quote
Brett Fleming (bflem...@vt.edu) wrote:

: Damned if nothing ever works the way it does in the {*word*30}ing online
: help! After fidgiting with this problem for 3 days, I've come to the
: conclusion that this feature must not be implemeted!
You're right - in this case the online help is simply WRONG - I ran into
that problem some time ago.

[some code with TMemoField.Getdata]

The solution is to use streams instead, to be more exact TBlobStream. Sorry,
but I don't have a working example at hand, maybe Steve T. will post his one
again (the one that helped me to get it running).

Hope that helps,
    Andy

--
----------------------------------------------------------------------------
Andreas H"orstemeier                       | This Signature is Shareware
email: hoer...@hal1.physik.uni-dortmund.de |
       a...@farpoint.sauerland.de          | Please pay $10 to read
fido:     2:2444/4505.3                    |
astronet: 122/490/1.53                     |
----------------------------------------------------------------------------  

Other Threads