Creating secondary index during runtime 
Author Message
 Creating secondary index during runtime

I have a master/detail relationship between two Paradox tables that I
create during runtime. I'm sucessful at creating the primary index for
each of the tables, but I can't figure out how to build the secondary
index for the detail table. Any clues or code on how to create it?

BTW, using Database Desktop is not an option; I have to do all of this
during runtime.



Wed, 18 Jun 1902 08:00:00 GMT  
 Creating secondary index during runtime

Quote:

>I have a master/detail relationship between two Paradox tables that I
>create during runtime. I'm sucessful at creating the primary index for
>each of the tables, but I can't figure out how to build the secondary
>index for the detail table. Any clues or code on how to create it?

>BTW, using Database Desktop is not an option; I have to do all of this
>during runtime.

One way would be to use the TTable.AddIndex method. For instance, on the
Detail table's field named SomeField:

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

Another way is to use the local SQL statement CREATE INDEX. Execute the
statement from a TQuery using its ExecSQL method.

  CREATE INDEX SomeField ON TableName (SomeField)

Local SQL (what the BDE uses for dBASE, Paradox, and FoxPro tables) is
documented in the online help file LOCALSQL.HLP, found in the main BDE
directory. This help file is a language reference of the local SQL
implementation (subset) of SQL-92. The copy of this file that came with BDE
4.x (and earlier versions) was outdated and has since been rewritten.
Updated copies will have the topic "Unsupported language" in the index (and
lack of this topic indicates a pre-update copy). I can e-mail you a copy of
the updated file if you need and desire it.

And still another way is to use the BDE API function DbiAddIndex,
documented in the BDE API help. But as the TTable.AddIndex method is a
wrapper around this API function, there is seldom a pressing need to use
it.

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski              "Health nuts are going to feel stupid someday,
Felton, CA                  lying in hospitals dying of nothing."
                                                              -- Redd Foxx



Wed, 18 Jun 1902 08:00:00 GMT  
 Creating secondary index during runtime

Quote:



>>I have a master/detail relationship between two Paradox tables that I
>>create during runtime. I'm sucessful at creating the primary index for
>>each of the tables, but I can't figure out how to build the secondary
>>index for the detail table. Any clues or code on how to create it?

>>BTW, using Database Desktop is not an option; I have to do all of this
>>during runtime.

>One way would be to use the TTable.AddIndex method. For instance, on the
>Detail table's field named SomeField:

>  Table1.AddIndex('SomeField', 'SomeField', []);

I tried that:

   Add('ProfileListIndex', 'ProfileNumb' , []);

I always get "Invalid index/tag name".

Quote:

>Another way is to use the local SQL statement CREATE INDEX. Execute the
>statement from a TQuery using its ExecSQL method.

>  CREATE INDEX SomeField ON TableName (SomeField)

Thats what I'll try next.


Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. creating secondary index in paradox table at runtime??

2. Creating secondary indexes ay runtime...

3. Creating Secondary Indexes at Runtime, Help...

4. How to create secondary indexes at runtime?

5. How to create Fields during runtime

6. Add a secondary index to a database in runtime

7. Create Paradox Secondary Index on the fly?

8. Creating Paradox Databases & indexes during run-time

9. Error creating secondary index

10. paradox7 tables-creating secondary index without primary

11. Creating secondary index fails

12. Creating secondary index with ixDescending

 

 
Powered by phpBB® Forum Software