解决方案 »

  1.   

    var
      rs:TAdoquery;
      x:integer;
    begin
      rs:=TAdoquery.create(nil);
      rs.connection:=con1;   //con1为已经设置好的数据库链接 TADOConnection
      rs.CursorLocation:=cluseserver;
      rs.CursorType:=ctstatic;
      rs.sql.text:='Select * from table1';
      rs.open;
      for x:=0 to rs.fieldcount-1 do
      begin
        if rs.fields[x].datatype=ftAutoInc then
        begin
          showmessage('field' + rs.fields[x].FieldName + 'is autoincrement');
        end;
      end;
    end;
      

  2.   


    var
      rs:TAdoquery;
      x:integer;
    begin
      rs:=TAdoquery.create(nil);
      rs.connection:=con1;   //con1为已经设置好的数据库链接 TADOConnection
      rs.CursorLocation:=cluseserver;
      rs.CursorType:=ctstatic;
      rs.sql.text:='Select * from table1';
      rs.open;
      for x:=0 to rs.fieldcount-1 do
      begin
        if rs.fields[x].datatype=ftAutoInc then
        begin
          showmessage('field' + rs.fields[x].FieldName + 'is autoincrement');
        end;
      end;
    end;
      

  3.   

    seleron 代码完全正确!在此谢谢!
    结帖!观者有份!