function ADOTableToArray;
var
CellValue:Array of Array of variant;
I,J:integer
begin
if not ADOTable.active then exit;
setLength(CellValue,ADOTable.Fields.count); //设置数组列数
while I<ADOTable.RecordCount do
begin
Inc(I);
For J:=low(CellValue) to High(CellValue) do
begin
setlength(CellValue[J],I); 设置数组行数
CellValue[J,I]:=ADOTable.Fields[J].Value;
end;
ADOTable.Next;
end;
end;
之后就可以用CellValue[I,J]开读取其值了
procedure TForm1.Button10Click(Sender: TObject);
var
i: integer;
Arry_ : array [1..10] of string;
begin
i:=1
While not AdoQuery1.Eof do
Begin
if AdoQuery1.FieldByName('column')<>'' then//想过滤条件在这里写
Begin
arry_[i]:= AdoQuery1.FieldByName('column').AsString ;
i:=i+1;
End
Else
Begin
i:=i+1;
End;
***
AdoQuery1.next;
End;
end;
//死了,发烧不行了,SORRY,就写到这里,,