Article View: comp.lang.pascal.delphi
Article #2Re: Access - Delphi - Master/Detail
From: VHA PC Development
Date: Wed, 08 Apr 1998 00:00
Date: Wed, 08 Apr 1998 00:00
67 lines
4010 bytes
4010 bytes
Frederic, I'm not sure how much you know about Access so I'm not going to make any assumptions. First, make sure that the Table in Access has a LongInteger or Autonumber primary key (avoid textual keys!); second, make sure that the table is indexed for ALL link fields; thirdly, if you are using a TQuery, make sure that your SQL returns a recordset that has one of the key/indexed fields returned within it. Now, the way Access does it. Access uses Rushmore Query Technology which allows it to return (for Dynasets or modifiable sets of records) just the primary or indexed key value that uniquely identifies a row - if one is not available, it creates one or returns the whole row (ssllooww). Access then populates the visible rows on the screen while retrieving the remainder of the rows in the background. Access's way APPEARS to be faster to the user but actually takes relatively longer to return the complete recordset due to the additional processing involved. Delphi has to get the whole thing THEN begin to display. The reason for this is that TQuery returns a complete recordset based on an SQL string that may include cached editable rows. (At least that is my understanding) Access and VB get at the data through the Access Compatibility Layer which Delphi has not, to my knowledge, been afforded uh... access to. MS Programs are intimately compatible with themselves. On your master/detail form, the recordset object must be requeried, refreshed and redisplayed which has to go through all the levels (both Delphi objects, ODBC and Access DLL's) back to the data. Besides tweaking your recordset objects in Delphi and making sure that there are unique indexed keys in access, I can't think of anything else that would make the process faster. I'm going to have to do some research to see if I can improve data retrieval times with Delphi using Access databases - then I'll share my results. :) -- ======================================= codifex@airmail.NOSPAM.net bgravitt@vha.NOSPAM.com ======================================= Fr�d�ric GUILLIEN <fguillien@hol.fr> wrote in article <352B6ED7.6DC@hol.fr>... > Hi, > > Opening an ACCESS table with Master/Detail links is very very slow. > Without the M/D link, the table open correctly : it's acceptable, but > when I set the link, it's awfully slow ! > > Do you know where the machine hang with this. I tried the same link with > Access and it works well. With VB also. > > As I forced to choose Delphi to create this part of the program, I don't > want the app to be slower than VB first module I developed last year... > > I hope there is an easy solution. > > -- > Fr�d�ric GUILLIEN > > Here is my Web site. Yet all in french (sorry, time missing...) > http://wwwperso.hol.fr/~fguillei > > Show your support for the Best Windows Development Tool > Join TDAG (The Delphi Advocacy Group) > http://home1.gte.net/mikep/tdag.html >
Technical Details
Message-ID:
<01bd6301$7754b880$8383050a@bgravitt.corp.vha.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<352B6ED7.6DC@hol.fr>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: ffff5,ab086b1e9e80e9f8 X-Google-Attributes: gidffff5,public X-Google-Thread: ff75c,ab086b1e9e80e9f8 X-Google-Attributes: gidff75c,public X-Google-Thread: 104e31,47c2e884be479cb9 X-Google-Attributes: gid104e31,public X-Google-Thread: 1043cf,ab086b1e9e80e9f8 X-Google-Attributes: gid1043cf,public X-Google-Thread: f973d,ab086b1e9e80e9f8 X-Google-Attributes: gidf973d,public X-Google-Thread: fd817,ab086b1e9e80e9f8 X-Google-Attributes: gidfd817,public From: "VHA PC Development" <codifex@airmail.net> Subject: Re: Access - Delphi - Master/Detail Date: 1998/04/08 Message-ID: <01bd6301$7754b880$8383050a@bgravitt.corp.vha.com> X-Deja-AN: 342084328 References: <352B6ED7.6DC@hol.fr> Organization: VHA Inc. X-NETCOM-Date: Wed Apr 08 10:16:02 AM CDT 1998 Newsgroups: comp.lang.pascal.delphi,alt.comp.lang.borland-delphi,alt.lang.delphi,comp.lang.pascal.delphi.databases,borland.public.delphi.objectpascal,borland.public.delphi.database.desktop