Alors, comment faire pour éviter de perdre des données lors d'un transtypage de tables ?
2- En voulant supprimer ces champs chamboulés, j'ai fait le code suivant, mais tout les champs de la table sont effaces sans exception :
procedure TForm1.Button1Click(Sender: TObject);
var
i, Caractere : integer;
S : String;
begin
Caractere:=0;
Table1.Open;
TAble1.First;
While not Table1.EOF do
begin
With Table1 do
begin
i:=1;
S:=FieldByName('ref').asstring;
//ShowMessage(s);
if s='' then
Delete;
While i<= length(S) do
begin //end
if not (S[i] in ['0'..'9','']) then Caractere:=Caractere+1;
inc(i);
end;
if Caractere > 1 then // S à au mini 1 caracteres
begin
if MessageDlg('Voulez-vous continuer',mtConfirmation,[mbYes, mbNo],0)=mryes then
begin
Delete;
//Next;
end
Else Exit;
end;
Next;
end;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
StatusBar1.Panels[0].Text:=IntToStr(Table1.Recno);
StatusBar1.Panels[1].Text:=IntToStr(Table1.Recordcount);
StatusBar1.Panels[2].Text:=Table1.TableName;
end;