Help: Creating indexes on tables at runtime 
Author Message
 Help: Creating indexes on tables at runtime

I am using delphi 3
My old application is written in Clipper sitting on top of dbase (*.dbf)
databases.  So far, my DELPHI3 application automatically converts the
*.dbf files over to the (ttdefault *.db) tables using batchmove.

I would like to automatically create predefined indexes at runtime for
these tables but have been having a difficult time doing so without
error messages.  I think I am missing a basic concept here.

How do I create an index, assuming the following?

     table1.databasename:=defaultsubdir;
     table1.tablename:='customer';
     table1.tabletype:=ttdefault;
     table1.AddIndex('fullname','co_full',[ixprimary]);
     table1.open;

Thanks



Tue, 01 May 2001 03:00:00 GMT  
 Help: Creating indexes on tables at runtime
Have you set table1.Exclusive := True?
The table must not be open anywhere else, whether by another
user, or even by yourself, when you restructure or build indexes.
That includes not having the table active in some component in
design mode.
T
: I am using DELPHI 3
: My old application is written in Clipper sitting on top of dbase (*.dbf)
: databases.  So far, my DELPHI3 application automatically converts the
: *.dbf files over to the (ttdefault *.db) tables using batchmove.

: I would like to automatically create predefined indexes at runtime for
: these tables but have been having a difficult time doing so without
: error messages.  I think I am missing a basic concept here.

: How do I create an index, assuming the following?

:      table1.databasename:=defaultsubdir;
:      table1.tablename:='customer';
:      table1.tabletype:=ttdefault;
:      table1.AddIndex('fullname','co_full',[ixprimary]);
:      table1.open;

: Thanks

--
============================================================

============================================================



Tue, 01 May 2001 03:00:00 GMT  
 Help: Creating indexes on tables at runtime

Quote:

>I am using DELPHI 3
>My old application is written in Clipper sitting on top of dbase (*.dbf)
>databases.  So far, my DELPHI3 application automatically converts the
>*.dbf files over to the (ttdefault *.db) tables using batchmove.

>I would like to automatically create predefined indexes at runtime for
>these tables but have been having a difficult time doing so without
>error messages.  I think I am missing a basic concept here.

>How do I create an index, assuming the following?

>     table1.databasename:=defaultsubdir;
>     table1.tablename:='customer';
>     table1.tabletype:=ttdefault;
>     table1.AddIndex('fullname','co_full',[ixprimary]);
>     table1.open;

What are the exact errors you are incurring? Your use of the
TTable.AddIndex method looks correct, but there could be other peripheral
factors that can cause problems. One sideline factor is the need to have
the TTable in exclusive mode (see the TTable.Exclusive property).

//////////////////////////////////////////////////////////////////////////
Steve Koterski                      "The knowledge of the world is only to
Technical Publications              be acquired in the world, and not in a
INPRISE Corporation                 closet."
http://www.inprise.com/delphi          -- Earl of Chesterfield (1694-1773)



Tue, 01 May 2001 03:00:00 GMT  
 Help: Creating indexes on tables at runtime

Quote:
>How do I create an index, assuming the following?

>     table1.databasename:=defaultsubdir;
>     table1.tablename:='customer';
>     table1.tabletype:=ttdefault;
>     table1.AddIndex('fullname','co_full',[ixprimary]);
>     table1.open;

If you want to create a primary index for a Paradox table, set Indexname to an
empty string. If you intended to create a secondary index, then don't use the
ixprimary option.

Wish you success
--
Achim Richter
Hessische Zentrale fuer Datenverarbeitung
Wiesbaden, Germany



Sun, 06 May 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

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

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

3. Help: Creating Tables at runtime.

4. Create a Paradox Table at Runtime Please Help

5. Help creating at runtime dBase tables

6. Please help : database table index at runtime

7. Creating index at runtime

8. Creating secondary indexes ay runtime...

9. Creating secondary index during runtime

10. How to re-create MDX index for dBASE at runtime

11. Creating an index at runtime

12. Creating DBF Indexes at RunTime, How?

 

 
Powered by phpBB® Forum Software