Hi all
Stuck in a little problem:
Creating a mail - and via a report creating a PDF-file in Temp-dir and then attach the PDF to the mail.
Mail.SEND is done
Then make the following:
Ok := FILE.EXISTS(PDFfilename);
IF Ok = TRUE THEN
FILE.ERASE(PDFfilename);
This gives an error saying that file is open in FIN.EXE
How to enable me to erase this file?
0
Comments
Mail.Dispose // If you don't have this method you need an upper version
after
Mail.Send(....)
Mal.dll does not release the file lock. There is an updated version of mail.dll available since years but it was never integrated into the 2009 installers.
Verson 7.1.0.0 does fix the problem of file locks but brings in new problems with character sets.
Version 7.3.0.1 does fix the above problems and runs with several customer flawlessly.
Another possibility, depends on your code:
Try to separate the process which creates the pdf and the code which deletes the file:
- report does some things
- call 2nd report (local var) which creates the pdf
- return to 1st report, destroy local var to second report and delete the file
FD Consulting