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
On Tue, 30 Mar 1999 07:54:45 GMT, 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

There are a few different ways to programatically add a secondary index to
an already existing Paradox table. One way is with the TTable.AddIndex
method.

  Table1.AddIndex('LastName', 'LastName', []);

Another way is with a CREATE INDEX statement executed from a TQuery.

  CREATE INDEX LastName ON "YourTable.db" (LastName)

And still another way, albeit considerably more complicated, is the BDE API
function DbiAddIndex. BDE API functions are documented in the BDE online
help file, BDE32.HLP, found in the main BDE directory.

//////////////////////////////////////////////////////////////////////////
Steve Koterski                 "Like a camel, I can go without a drink for
Technical Publications         seven days--and have on several horrible
INPRISE Corporation            occasions."
http://www.borland.com/delphi                                 -- Herb Caen

Other Threads