Ako trebas da pokupis integere iz recordseta mozes sa TStringList
procedure GetFieldsToArray(rst:TDataSet;fld:TField):TStringList;
var
lst:TStringList;
begin
if not rst.Active then rst.active := True;
if not rst.FindField(fld) then exit;
lst := TStringList.Create;
rst.First;
while not rst.EOF do
begin
lst.Add(rst.FieldByName(fld.FieldName).AsString);
rst.Next;
end;
result := lst;
end;
a mozes i da kreiras niz umesto lst
var
arr : array of Integer;
iCount, i :Integer;
begin
iCount := rst.RecordCount;
SetLength(arr,iCount);
for i := 0 to iCount-1 do
begin
arr := rst.FieldByname(fld.Name).AsInteger;
rst.Next;
end;
a mozes i da kreiras niz umesto lst
var
arr : array of Integer;
iCount, i :Integer;
begin iCount := rst.RecordCount;
SetLength(arr,iCount);
for i := 0 to iCount-1 do
begin
arr := rst.FieldByname(fld.Name).AsInteger;
rst.Next;
end;
Nije moguce kod svih baza raditi sa RecordCount posto on kod nekih (za Interbase znam sigurno) ne vraca ukupan broj redova vec samo koliko je trenutno povuceno iz baze, a to je kod upita sa vecim rezultatom uvek manje od ukupnog broja redova.
P.S. Znam da je bogiboy ovo naveo samo kao primer, ali za svaki slucaj :)