请问怎么把ACCESS表中的数据赋给一个数组呢?
比如我要把表中的年龄字段赋给AGE[1..20],怎么做?

解决方案 »

  1.   

    我是楼主,请问代码要怎么写呢???
    怎么用程序取得表中的数据?
    AGE[0]:=Table1.?????
      

  2.   

    for i:=1 to 20 do
     begin 
      AGE[i]:=Table1.?????
      Table1.next;
     end;
      

  3.   

    没什么简单的办法
    只能是循环
    with ADOQuery1 do
    begin
      sql.clear;
      sql.add('select .....');//查询语句自己写完
      open;
      while not eof do
      begin 
        AGE[1] := FieldByName('xx').asstring;//假设为string类型
        //xx表示你要存入的字段名字,如果AGE的元素是integer,那么就用FieldByName('xx').asinteger
        Next;
      end;
    end;