Bonjour tous,
J'ai tout essayé, mais l'application se bloque toujours, on dirait dans une boucle...
Voilà ce que je trouve bizarre:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
procedure TForm1.Efface1Click(Sender: TObject);
begin
Form2.Table2.First;
while not Form2.Table2.EOF Do
begin
Table1.First;
while not Table1.EOF Do
begin
if (Table1.Locate('Serial',Form2.Table2Serial.value,[])) then
begin
Table1.Edit;
Table1.FieldByName('Rouge').asstring := 'O';
Table1.Post;
end;
Table1.Next;
end; Form2.Table2.Next;
end;
end; |
Ceci bloque l'application.
Ici j'obtiens le message d'érreur:
Table1: L'ensemble de données n'est pas en mode d'insertion ou edition
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
procedure TForm1.Efface1Click(Sender: TObject);
begin
Form2.Table2.First;
while not Form2.Table2.EOF Do
begin
Table1.First;
while not Table1.EOF Do
begin
if (Table1.Locate('Serial',Form2.Table2Serial.value,[])) then
Table1.FieldByName('Rouge').asstring := 'O';
Table1.Next;
end; Form2.Table2.Next;
end;
end; |
Alors que ceci:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
procedure TForm1.Efface1Click(Sender: TObject);
begin
Form2.Table2.First;
while not Form2.Table2.EOF Do
begin
Table1.First;
while not Table1.EOF Do
begin
if (Table1.Locate('Serial',Form2.Table2Serial.value,[])) then
Table1.Delete;
Table1.Next;
end; Form2.Table2.Next;
end;
end; |
...ceci marche impec!!!!
On dirait qu'il n'y a pas de solution...!
Partager