I have a very simple procedure that reads from one field in an ADOTable and writes the value in a different field. This is my code.
With Form_Main.ADOTable1 do
Begin
Week := 1;
Column_A := 'Week_' + IntToStr(Week) + 'A';
Column_B := 'Week_' + IntToStr(Week) + 'B';
Column_C := 'Week_' + IntToStr(Week) + 'C';
While NOT Form_Main.ADOTable1.EOF do
begin
if (FieldByName('EnvCash').AsString <> '')
then
begin
Env_Cash := (FieldByName('EnvCash').AsCurrency);
edit;
FieldByName('Week_1A').AsFloat := Env_Cash;
post;
end;
If (FieldByName('Check').AsString <> '')
then
begin
Chk := (FieldByName('Check').AsCurrency);
CheckNum := (FieldByName('CheckNum').AsString);
FieldByName('Week_1B').AsFloat := Chk;
FieldByName('Week_1C').AsString := CheckNum;
end;
next;
end;
end;
end;
Week is set to 1 for test purposes.
I get an error message:
“Query is too complex.’
What is my problem?
With Form_Main.ADOTable1 do
Begin
Week := 1;
Column_A := 'Week_' + IntToStr(Week) + 'A';
Column_B := 'Week_' + IntToStr(Week) + 'B';
Column_C := 'Week_' + IntToStr(Week) + 'C';
While NOT Form_Main.ADOTable1.EOF do
begin
if (FieldByName('EnvCash').AsString <> '')
then
begin
Env_Cash := (FieldByName('EnvCash').AsCurrency);
edit;
FieldByName('Week_1A').AsFloat := Env_Cash;
post;
end;
If (FieldByName('Check').AsString <> '')
then
begin
Chk := (FieldByName('Check').AsCurrency);
CheckNum := (FieldByName('CheckNum').AsString);
FieldByName('Week_1B').AsFloat := Chk;
FieldByName('Week_1C').AsString := CheckNum;
end;
next;
end;
end;
end;
Week is set to 1 for test purposes.
I get an error message:
“Query is too complex.’
What is my problem?