Problem with TQuery (Delphi 3.02 and MS SQL 6.5)

Hi folks,

I seem to have some performance problems which I can't seem to solve.  I am
using Delphi 3.02 and SQL Server 6.5 as a database.

I will try to do my best to describe what my problem is.  I have a TQuery
which will fetch the data from the articles table (ArticleID, ArticleName).
I also have a detail query which will get the Article details (ArtDetID,
ArticleID, SupplierID, UnitPrice, UnitID, ...).  I have set up the
ArticleDetail query so that it fetches the records for the current article
(by using ArticleID as parameter and fetching it from Query1's datasource).

Now comes my problem.  If I only open the first query, it will only fetch the
records which are necessary to fill the grid on the form (24 records).  If now
I also open the detail query it will fetch ALL articles records (approx 10300
records) and then fetch the details.  As you can see this will give some
performance problems (the user will have to wait a few seconds before the form

I thought that the TQuery would onle fetch the data which is required to fill
the controls which are on the form (the grid).  This is the case if I only
open the Article query.  But if I also open the detail query it will fetch
all article records.

I have already tried using a TTable as to fetch the detail records.  This
gives me the same problems.  Once I use a detail TQuery or TTable, the master
TQuery will fetch all the records from the Articles table instead of only
fetching the records which are necessary to fill the grid.

If anybody knows a solotion or a workaround for this, please let me know.

Another strange thing I noticed is concerning RXLib's DBLookupComboBox.  I
placed one on my form (for the detail query).  And if I through the master
records, the appropriate detail records are fetched, but apparently the
RxDBLookupComboBox doesn't select the appropriate item in the combo box.  If
scroll to the next detail record it does !.

Using a TTable for the Detail Records does solve the problem with the
RxDBLookupCombo though.

Any information concerning this problems is also welcome.  But please also
send a copy of your comment to my e-mail : Stefaan.Lesage at

-----------== Posted via Deja News, The Discussion Network ==----------       Search, Read, Discuss, or Start Your Own