Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sort the detail dataset

Posted on 1998-08-26
3
Medium Priority
?
170 Views
Last Modified: 2010-04-04
I have two tables linked by fields 'id' and 'doc_id' which produces the correct search results but when I sort detail table, relationship go broken.

How I may sort detail dataset without TQuery component?
(TQuery very slowly on Local DB)
0
Comment
Question by:Jam
  • 2
3 Comments
 

Author Comment

by:Jam
ID: 1337831
Edited text of question
0
 

Author Comment

by:Jam
ID: 1337832
Adjusted points to 75
0
 
LVL 1

Accepted Solution

by:
AndersWP earned 210 total points
ID: 1337833
You can do it be using an index for the detail table. Suppose your detail table has four fields: DOC_ID, DATE, TITLE and TEXT ( this is just an example) and that it is linked to field ID in the master table. To show the detail records sorted by DATE, you create an index for the detail table over the fields (DOC_ID, DATE) in that order. Depending on the database you are using, you should then set either the IndexFieldNames property of you detail TTable object to DOC_ID, DATE or the IndexFile property to the name of your index.
You can sort the detail table by TITLE by creating a (DOC_ID, TITLE) index etc. You can swicth from one sort to the other by changing the IndexFieldNames property at run-time. If you do this, you may need to do a Refresh on either the master or the detail table.

I hope this will help you.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question