Hi!
Here is my code:
void createCSVCurrencyFile()
{
Commaio file;
container line;
ExchRates exRates;
Str filename;
Str todayString;
FileIOPermission readPermission;
;
todayString = date2Str
(today(),
321,
DateDay::Digits2,
DateSeparator::Hyphen,
DateMonth::Digits2,
DateSeparator::Hyphen,
DateYear::Digits4
);
filename ="\\\\servername\\AX\\Currencies\\Rates_"+todayString+"_cmpy.csv";
readPermission = new FileIOPermission(filename, "w");
readPermission.assert();
file =new Commaio(filename , "w");
file.outFieldDelimiter(';');
if( !file || file.status() != IO_Status::Ok)
{
//throw error("File Cannot be opened");
}
while select exRates
where exRates.DataAreaId == 'cmp'
&& exRates.FromDate == today()
{
line = [
exRates.CurrencyCode,
//exRates.FromDate,
date2Str
(exRates.FromDate,
321,
DateDay::Digits2,
DateSeparator::Hyphen,
DateMonth::Digits2,
DateSeparator::Hyphen,
DateYear::Digits4
),
exRates.Exchrate];
file.writeExp(line);
}
CodeAccessPermission::revertAssert();
}
The job received the following error: CommaIo object not initialized.
any suggestion? :)
*This post is locked for comments
I have the same question (0)