Article View: borland.public.cppbuilder.database.ado
Article #3643ClientDataSet Lookup Field faster than CalculatedField?
From: Joachim
Date: Tue, 23 Jul 2002 15:42
Date: Tue, 23 Jul 2002 15:42
29 lines
1901 bytes
1901 bytes
Hi,
sorry for asking so much :)
Can I make this onCalcFields event faster?
void __fastcall TDM::CDKundenlisteCalcFields(TDataSet *DataSet)
{
if(DataSet->State == dsInternalCalc){
QADIS->Close();
QADIS->SQL->Text = "select max(Datum) as LBDatum from
Besuchsberichte where Kundennummer = " +
DataSet->Fields->FieldByName("Kundennummer")->AsString;
QADIS->Open();
DataSet->Fields->FieldByName("letzter Besuch")->AsDateTime =
Date();//QADIS->Fields->FieldByName("LBDatum")->AsDateTime;
}
}
Any Idears?
I am not using Params because of performance.
When I make a lookup field to the same database and set the Keys
"Kundennummer = Kundennummer" it is very much faster than the calculated
field. I can not use the lookup field because Kundennummer is not unique and
I want to display the latest date with the max(Datum).
But why is the lookup field so fast? The lookupfield has to calculate the
field too and search the other database, didn�t it?
Thanks,
Joachim
Technical Details
Message-ID:
<3d3d782c_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,75fae707291bdf5a,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-07-23 08:42:50 PST From: "Joachim" <mfgjojo@gmx.de> Newsgroups: borland.public.cppbuilder.database.ado Subject: ClientDataSet Lookup Field faster than CalculatedField? Date: Tue, 23 Jul 2002 17:42:12 +0200 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 NNTP-Posting-Host: 217.84.95.185 Message-ID: <3d3d782c_2@dnews> X-Trace: dnews 1027438636 217.84.95.185 (23 Jul 2002 08:37:16 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!dnews