adotable1,打开表table1,table1的字段有,姓名,性别,等
如何获取adotable1中的所有字段 。

解决方案 »

  1.   

    你可以先打开结构用  select * from table where colnum=0
    然后可以用循环取出  Field[i].Name
      

  2.   

    鼠标双击AdoTable1,后在出现的窗体上右键鼠标Add All Fields
      

  3.   

    没太看明白  所有字段用 select * 不就可以吗?
      

  4.   

    with adoquery do
    begin
      close;
    sql.text:='select * from table where 1<0';
    open;
    end;
    for i:=0 to adoquery.recordcount-1 do
    showmessage(adoquery.fields[i].fieldname)
      

  5.   

    to esu
    循环部分不对
    应该这样
    adotable.close;
    sql.add('select * from table where 1<''0''');
    adotable.open;
    for i:=0 to adotable.FieldCount-1 do
    showmessage(adotable.fields[i].fieldname)
      

  6.   

    更正sql.add('select * from table where 1<''0''');
    为adotable.sql.clear;
    adotable.sql.add('select * from table where 1<''0''');