At first I couldn't find the problem either. After I cleaned up your code a bit I realized that the filename you are using is not correct.
Code:
procedure TForm1.Button1Click(Sender: TObject);
var FACCR : TextFile;
VACID1 : string;
MACCFNAM : string;
VUNITIME1 : TDateTime;
VUNITIME2 : string;
VAMAIV : string;
begin
try
VACID1 := FIMANF1.MFIMANACNM1.Text; // <--- what is this ???
if not DirectoryExists('C:\HXACC') then CreateDir('C:\HXACC');
MACCFNAM := 'C:\HXACC\test-MDF.txt'; // replaced your string with a proper filename
AssignFile(FACCR, MACCFNAM);
if not FileExists(MACCFNAM) then // check here if you need to create or open a new file
rewrite(FACCR)
else
Reset(FACCR);
VUNITIME1 := Now;
VUNITIME2 := DateTimeToStr(VUNITIME1);
WriteLn(FACCR, VUNITIME2);
WriteLn(FACCR, '[ACCOUNT-ACTIVE]');
WriteLn(FACCR, VAMAIV);
CloseFile(FACCR);
except
//your exceptions here
end
end;
Bookmarks