Board index » delphi » Add a secondary index to a database in runtime

Add a secondary index to a database in runtime

How to add a secondary index to a database in Runtime ? The base is a Paradox
V7.0, and has already 1 primary and 2 secondary keys. We already tried some
stuff, at first view the index is added, but not created ? Thanks

Wim Vanmaele

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

 

Re:Add a secondary index to a database in runtime


Quote
wim...@my-dejanews.com wrote:

> How to add a secondary index to a database in Runtime ? The base is a Paradox
> V7.0, and has already 1 primary and 2 secondary keys. We already tried some
> stuff, at first view the index is added, but not created ? Thanks

What was your 'stuff' exactly? This is the basic code to add and
drop secondary indexes:

  Parts.Close;  
  Parts.AddIndex('ByDescription', 'Description', [ixCaseInsensitive]);{Add}

  ...
  Parts.Exclusive:=True;
  Parts.DeleteIndex('ByDescription');{Drop}
  Parts.Exclusive:=False;

Markku Nevalainen

Other Threads