各位大哥,小弟我碰到一个很急的事呀,请你们帮忙。如何创建TArrayField字段。最好能够给出一段实例。谢谢!很急。

解决方案 »

  1.   

    var
      ss:TArrayField ;
    begin
      try
        ss:=TArrayField.Create(nil);
        with ss do
        begin
          ss.DataSet := table1;
          操作ss即可  ;
        end;
      finally
        FreeAndNil(ss)
      end;
    end;
      

  2.   

    Using the array field's FieldValues propertyYou can access the value of a child field with the array field's FieldValues property. FieldValues accepts and returns a Variant, so it can handle and convert child fields of any type. For example, TelEdit.Text := TArrayField(Customer.FieldByName('TelNos_Array')).FieldValues[1];Because FieldValues is the default property of TArrayField, this can also be writtenTelEdit.Text := TArrayField(Customer.FieldByName('TelNos_Array'))[1];Using the array field's Fields propertyTArrayField has a Fields property that you can use to access individual sub-fields. This is illustrated below, where an array field (OrderDates) is used to populate a list box with all non-null array elements:for I := 0 to OrderDates.Size - 1 do
    begin
      if not OrderDates.Fields[I].IsNull then
        OrderDateListBox.Items.Add(OrderDates[I]);
    end;
      

  3.   

    天外流星,你的介意是从delphi 帮助中拿过来的,所以我看不懂,能不能具体一点。