Print Thread
Performance problem
#3718 07/17/02 05:05 PM
Joined: Oct 1999
Posts: 21
France
C
cgi Offline OP
Member
OP Offline
Member
C
Joined: Oct 1999
Posts: 21
France
On a dataset with several Fields "FieldKind=fkLookup' but without field" FieldKind=fkCalc'.

When the property "AutoCalFields = True"
= > Problem of performance.
When the property "AutoCalFields = False", => no problem of performance but the fields "FieldKind=fkLookup' are not refreshed in insertion mode!!

Is somebody has an explanation?




------------------
Christian Gincheleau


Christian Gincheleau
Re: Performance problem
#3719 07/17/02 11:06 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
Perhaps one or more lookup tables are very large?

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: Performance problem
#3720 07/18/02 10:15 AM
Joined: Oct 1999
Posts: 21
France
C
cgi Offline OP
Member
OP Offline
Member
C
Joined: Oct 1999
Posts: 21
France
[quote]Originally posted by mkalter:
Perhaps one or more lookup tables are very large?

[/quote]

No, lookup tables are not very large.

But which is the relationship between the property "AutoCalcFields"
and the fields of the type "FieldKind=fkLoopkup"
and why they are badly refreshed when the property "AutoCalcFields=False".

I am obliged to write the following code on the event "OndataChange"
of the "dataSource" connected to the "DataSet" :

procedure TAffaireDM.dsCdeLigneDataChange(Sender: TObject; Field: TField);
var
i : integer;
begin
if Assigned(Field) then
begin
if not Field.IsNull then
begin
for i := 0 to Field.DataSet.FieldCount - 1 do
begin
if Field.DataSet.Fields[i].FieldKind = fkLookup then
if Field.DataSet.Fields[i].KeyFields = Field.FieldName then
Field.DataSet.Fields[i].Value := Field.DataSet.Fields[i].LookupDataSet.FieldByName(Field.DataSet.Fields[i].LookupResultField).Value;
end;
end;
end;
end;


------------------
Christian Gincheleau


Christian Gincheleau
Re: Performance problem
#3721 07/18/02 08:42 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
If AutoCalcFields = False, lookups are not automatically performed. This does not explain the actual performance problem of course.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.035s Queries: 13 (0.011s) Memory: 2.5150 MB (Peak: 3.0430 MB) Data Comp: Off Server Time: 2024-05-17 03:06:05 UTC
Valid HTML 5 and Valid CSS