I have a Procedure tha contains the following code:
With ADOTable2 do
begin
first;
active := true;
for I := 1 to 52 do
begin
edit;
ADOTable2.FieldByName('Week').AsString := teNameArray;
ADOTable2.FieldByName('DateName').AsString := WeekNameArray;
ADOTable2.FieldByName('WeekName').AsString := WeekArray;
ADOTable2.FieldByName('Collect').AsInteger := 0;
ADOTable2.FieldByName('Visitor').AsInteger := 0;
ADOTable2.FieldByName('Unresolved').AsString := '';
post;
next;
end;
end;
When I run it I get the following error when I = 1 when post is executed.
Project Project2.exe raised exception class EDataBaseError with message, ‘Key column information is insufficient or incorrect. Too many rows affected by update’.
The Arrays are all verified as correct. The ADOTable2 contains 52 records and 6 fields. ADOTable 1 uses the same ADOConnection and it runs with no problem. The ADOTable2 is an Access 2010 database.
I have been using ADOTables for over 10 years in programs and I have never seen this error before. I am running Delphi 7 on a Windows 7 machine.
What is my problem and what is the solution?
With ADOTable2 do
begin
first;
active := true;
for I := 1 to 52 do
begin
edit;
ADOTable2.FieldByName('Week').AsString := teNameArray;
ADOTable2.FieldByName('DateName').AsString := WeekNameArray;
ADOTable2.FieldByName('WeekName').AsString := WeekArray;
ADOTable2.FieldByName('Collect').AsInteger := 0;
ADOTable2.FieldByName('Visitor').AsInteger := 0;
ADOTable2.FieldByName('Unresolved').AsString := '';
post;
next;
end;
end;
When I run it I get the following error when I = 1 when post is executed.
Project Project2.exe raised exception class EDataBaseError with message, ‘Key column information is insufficient or incorrect. Too many rows affected by update’.
The Arrays are all verified as correct. The ADOTable2 contains 52 records and 6 fields. ADOTable 1 uses the same ADOConnection and it runs with no problem. The ADOTable2 is an Access 2010 database.
I have been using ADOTables for over 10 years in programs and I have never seen this error before. I am running Delphi 7 on a Windows 7 machine.
What is my problem and what is the solution?