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 ' + MySQLTable1.TableName +
           ' are:'#13#10#13#10;
   for i := 0 to MySQLTable1.FieldCount - 1 do
      Info := Info + MySQLTable1.Fields[i].FieldName + #13#10;
  ShowMessage(Info);
end;