如果你用的是SQL-SERVER的话,可以从系统表中得出

解决方案 »

  1.   

    具体请参阅BDE的帮助
    The function is:
    fDbiGetRIntDesc(OrdersTbl, 1, MyList);function fDbiGetRIntDesc(Table: TTable; SeqNo: Word; RIntList: TStringList): RINTDesc;var
      ThisTable, OtherTable: string;
      Props: CURProps;
      B: Byte;
    begin
      ThisTable := '';
      OtherTable := '';
      FillChar(Result, sizeof(Result), #0);
      Check(DbiGetCursorProps(Table.Handle, Props));
      if (Props.iRefIntChecks = 0) then
        raise EDatabaseError.Create('There are no referential integrity checks on this table');
      Check(DbiGetRIntDesc(Table.Handle, SeqNo, @Result));
      if (RIntList <> nil) then begin    with RIntList do begin
          Add(Format('NUMBER=%d', [Result.iRintNum]));
          Add(Format('NAME=%s', [Result.szRintName]));
          case Result.eType of
            rintMASTER: Add('TYPE=MASTER');
            rintDEPENDENT: Add('TYPE=DEPENDENT');
          else
            Add('TYPE=UNKNOWN');
          end;
          Add(Format('OTHER TABLE=%s', [Result.szTblName]));
          case Result.eModOp of
            rintRESTRICT: Add('MODIFY=RESTRICT');        rintCASCADE: Add('MODIFY=CASCADE');
          else
            Add('MODIFY=UNKNOWN');
          end;
          case Result.eDelOp of
            rintRESTRICT: Add('DELETE=RESTRICT');
            rintCASCADE: Add('DELETE=CASCADE');
          else
            Add('DELETE=UNKNOWN');
          end;
          Add(Format('FIELD COUNT=%d', [Result.iFldCount]));
          for B := 0 to DBIMAXFLDSINKEY do begin
            if (Result.aiThisTabFld[B] <> 0) then begin          if (B <> 0) then
                ThisTable := Format('%s, %d', [ThisTable, Result.aiThisTabFld[B]])
              else
                ThisTable := IntToStr(Result.aiThisTabFld[B]);
            end
            else
              Break;
          end;
          Add('FIELDS=' + ThisTable);
          for B := 0 to DBIMAXFLDSINKEY do begin
            if (Result.aiOthTabFld[B] <> 0) then begin
              if (B <> 0) then            OtherTable := Format('%s, %d', [OtherTable, Result.aiOthTabFld[B]])
              else
                OtherTable := IntToStr(Result.aiOthTabFld[B]);
            end
            else
              Break;
          end;
          Add('FIELDS OTHER=' + OtherTable);
        end;
      end;
    end;
      

  2.   

    太谢谢BLUECAT了,不过如果我用ADO而不用BDE的话,有办法么?