The code below creates the txt file but does not write to it. What can it be?
procedure TForm1.Button4Click(Sender: TObject);
var
arq: TextFile;
begin
qr.Active:= true;
qr.First;
try
AssignFile(arq, 'd:\tabuada.txt');
Rewrite(arq);
writeln(arq, 'teste');
while not qr.Eof do
begin
writeln(arq, qr.FieldValues['ine'] + ';' + qr.FieldValues['cmp'] + ';' + qr.FieldValues['cbo'] + ';' + qr.FieldValues['pa'] + ';' + qr.FieldValues['idade'] + ';' + '1;' + qr.FieldValues['quant'] + ';' + qr.FieldValues['profissional'] + ';' + qr.FieldValues['cnesdescricao'] + ';' + qr.FieldValues['cbodescricao'] + ';' + qr.FieldValues['padescricao']);
qr.Next;
end;
CloseFile(arq);
ShowMessage('ok2');
except
end;
end;
No error and no 'ok2' message