Board index » delphi » How I do to create a secondary index to paradox tables without the DataBase DeskTop

How I do to create a secondary index to paradox tables without the DataBase DeskTop

How I do to create a secondary index to paradox tables without the DataBase
DeskTop

 

Re:How I do to create a secondary index to paradox tables without the DataBase DeskTop


Use a TQuery component and the  SQL ADD INDEX command or use the
TTable.AddIndex method.

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:How I do to create a secondary index to paradox tables without the DataBase DeskTop


On 12 Mar 1998 23:59:22 GMT, "Luciano Faria da Silva"

Quote
<fa...@mail.sky.com.br> wrote:
>How I do to create a secondary index to paradox tables without the DataBase
>DeskTop

There are three ways (listed here in order of difficulty, easiest to
hardest):

1. The TTable.AddIndex method.

   Table1.AddIndex('IndexName', 'FieldName', [ixCaseInsensitive]);

2. The SQL statement CREATE INDEX, issued from a TQuery component.

   CREATE INDEX IndexName ON "TableName.db" (FieldName)

3. The BDE API function DbiAddIndex. For examples see the BDE online help
   or go to the BDE support Web page:

   http://www.borland.com/devsupport/bde/bdeapiex/

**************************************************************************
Steve Koterski
Borland International, Inc.
http://www.borland.com/delphi
(Remove the "SPICEDHAM2" from the address. Death to spam-bots!)

Re:How I do to create a secondary index to paradox tables without the DataBase DeskTop


My table does not have a Primary index. Maybe it's the problem, but with the
Database Desktop I could create my index without problems and without a primary
index.
Why the Database Desktop can and I can not?
I need only one index to this table and It can't be unique.
Does the Primary index have to be unique?

Steve Koterski escreveu:

Quote
> On 12 Mar 1998 23:59:22 GMT, "Luciano Faria da Silva"
> <fa...@mail.sky.com.br> wrote:

> >How I do to create a secondary index to paradox tables without the DataBase
> >DeskTop

> There are three ways (listed here in order of difficulty, easiest to
> hardest):

> 1. The TTable.AddIndex method.

>    Table1.AddIndex('IndexName', 'FieldName', [ixCaseInsensitive]);

> 2. The SQL statement CREATE INDEX, issued from a TQuery component.

>    CREATE INDEX IndexName ON "TableName.db" (FieldName)

> 3. The BDE API function DbiAddIndex. For examples see the BDE online help
>    or go to the BDE support Web page:

>    http://www.borland.com/devsupport/bde/bdeapiex/

> **************************************************************************
> Steve Koterski
> Borland International, Inc.
> http://www.borland.com/delphi
> (Remove the "SPICEDHAM2" from the address. Death to spam-bots!)

  vcard.vcf
< 1K Download

Re:How I do to create a secondary index to paradox tables without the DataBase DeskTop


On Fri, 13 Mar 1998 10:05:57 -0300, "Luiz Guilherme M.K."

Quote
<L...@Hotmail.Com.Br> wrote:
>My table does not have a Primary index. Maybe it's the problem, but with the
>Database Desktop I could create my index without problems and without a primary
>index.
>Why the Database Desktop can and I can not?
>I need only one index to this table and It can't be unique.
>Does the Primary index have to be unique?

Paradox secondary indexes for tables that do not have primary indexes are
referred to as "non-maintained." Some applications have built-in means to
accommodate non-maintained indexes, like Paradox and the Database Desktop
utility (which is just a pared down copy of Paradox). Delphi does not
support the creation or use of non-maintained Paradox indexes with any
built-in mechanisms. You might be able to "fudge it" using direct calls to
BDE API functions, but those are some hoops to jump through when dealing
with the black-box nature of the VCL.

Data can always be unique. Sometimes it is unique based on only a single
field across all records. Other times, the uniqueness of records is
determined with the combination of multiple fields, necessitating a
compound unique index based on those multiple fields. And still other times
you may need to adapt an otherwise less satisfactory table design by adding
a new column with unique values for each record.

Yes, a primary index is by definition a unique index. This uniqueness is
predicated on the field or fields on which the primary index is based.

**************************************************************************
Steve Koterski
Borland International, Inc.
http://www.borland.com/delphi
(Remove the "SPICEDHAM2" from the address. Death to spam-bots!)

Other Threads