EPUB | CHM | PDF

Example: FieldCount, Fields, FieldName

Top Previous Next

This example displays a message box with the names of all fields in the table.

procedure TForm1.Button2Click(Sender: TObject);
var
   i: Integer;
   Info: String;
begin
   Info := 'The fields of table ' + PSQLTable1.TableName +
           ' are:'#13#10#13#10;
   for i := 0 to PSQLTable1.FieldCount - 1 do
      Info := Info + PSQLTable1.Fields[i].FieldName + #13#10;
  ShowMessage(Info);
end;