Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADOTable write problem

Status
Not open for further replies.

MLNorton

Programmer
Nov 15, 2009
134
US
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?
 
I believe you hit the column limit in access:


Didn't you already have a thread about this.
Avoid using TADOTable all together and use TADOQueries instead.
Other solution is to redesign the database, it has issues...

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top