Check if table is empty

Posted in Databases

Use RecordCount property of Table component. If RecordCount is 0, then table is empty.

procedure TForm1.Button1Click(Sender: TObject);
begin
  if Table1.RecordCount=0 then
    Label1.Caption:='Table is emply'
  else
    Label1.Caption:='Table is not emply';
end;