BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How adding a secondary index.

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
Hubert Anemaat
Guest





PostPosted: Wed Jan 21, 2004 9:55 am    Post subject: How adding a secondary index. Reply with quote



Hello,

How can I sort on a field by clicking on the title in a DBGrid ?
When using TTable.AddIndex I get an error that TTable is not in exclusive
use.
I cannot set TTable to Exclusive := True because the application is used in
a multi-user environment.
Do I have to create the indexes of all fields when starting the first
application in the network ?
Or is there another solution ?

Hubert Anemaat


Back to top
Bill Todd (TeamB)
Guest





PostPosted: Wed Jan 21, 2004 2:13 pm    Post subject: Re: How adding a secondary index. Reply with quote



Indexing every field will hurt performance when you insert or update
records. If you really want to index every field make sure the table
has a primary key then add maintained secondary indexes once at design
time. You will never need to add them again while the system is in
use.

A better solution is to use a TClientDataSet and a TQuery. Let the
user select just the records they wan to work with into the CDS. You
can then sort the records by assigning the field name to the
IndexFieldNames property.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
Back to top
Hubert Anemaat
Guest





PostPosted: Thu Jan 22, 2004 11:06 am    Post subject: Re: How adding a secondary index. Reply with quote



Thanks a lot, Bill.

Hubert

"Bill Todd (TeamB)" <no (AT) no (DOT) com> schreef in bericht
news:o22t00d6jf4325dku17go8ltrncqo9k6v9 (AT) 4ax (DOT) com...
Quote:
Indexing every field will hurt performance when you insert or update
records. If you really want to index every field make sure the table
has a primary key then add maintained secondary indexes once at design
time. You will never need to add them again while the system is in
use.

A better solution is to use a TClientDataSet and a TQuery. Let the
user select just the records they wan to work with into the CDS. You
can then sort the records by assigning the field name to the
IndexFieldNames property.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.