procedure opentable1;
begin
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
begin
Table1.IndexDefs.options:=[ixDescending];
if Table1.IndexDefs.Items.Fields = 'CustNo;OrderNo' then
{ set that index as the current index for the table }
Table1.IndexName := Table1.IndexDefs.Items.Name;
end;
Table1.Exclusive := False;
Table1.Active := True;
end;
以上代码可能有错,具体请察看一下indexdefs.options的帮助。