Delphi Programming

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

Determine the actual size of a Blob field in a Table

By Zarko Gajic, About.com

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

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Delphi Programming

  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.