看帮助说可以利用Table的IndexName属性来实现,可是多次试验没有成功,程序报错:”Index out of date“。

解决方案 »

  1.   

    好像在Paradox中INDEXNAME和INDEXFILEDNAMES只能是索引字段
      

  2.   

    用 Tabel.Sort:='sortfield asc' 实实现
      

  3.   

    Table1.Active := False;Table1.Exclusive := True;{ Get the current available indices }Table1.IndexDefs.Update;
    { Find one which combines Customer Number ('CustNo') and Order Number ('OrderNo') }
    for I := 0 to Table1.IndexDefs.Count - 1 do
      if Table1.IndexDefs.Items[I].Fields = 'CustNo;OrderNo' then
        { set that index as the current index for the table }
        Table1.IndexName := Table1.IndexDefs.Items[I].Name;
    Table1.Exclusive := False;Table1.Active := True;