1. Home
  2. Computing & Technology
  3. Delphi Programming

Determine the actual size of a Blob field in a Table

By , About.com Guide

Here is a function GetBlobSize that returns the size of a given blob, memo, or graphic field.

~~~~~~~~~~~~~~~~~~~~~~~~~
Function GetBlobSize(Field: TBlobField): Longint;
begin
  with TBlobStream.Create(Field, bmRead) do
   try
    Result := Seek(0, 2) ;
   finally
    Free;
   end;
end;

{ Usage: }
procedure TForm1.Button1Click(Sender: TObject) ;
begin
{This sets the Edit1 edit box to display the size of}
{a memo field named Notes.}
Edit1.Text := IntToStr(GetBlobSize(Notes)) ;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» Path Shortener: c:\AB\C...DE\F.ghi
« TMemo printing

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2000 Delphi Tips
  7. Determine the actual size of a Blob field in a Table

©2009 About.com, a part of The New York Times Company.

All rights reserved.