AV when trying to add string to memo
Does anybody have an idea why the below code AVs?
FrxClientDataSet.Close;
FrxClientDataSet.CommandText:=cmdstr;
FrxClientDataSet.Open;
if FrxClientDataSet.RecordCount>0 then
begin
frxreport.LoadFromFile(appdir+cMDRaveReportPath+tmpstr+'.fr3');
tmpstr:='From '+formatdatetime('m/dd/yyyy',fromdatetimepicker.Date)+' to '+formatdatetime('m/d/yyyy',todatetimepicker.Date);
try
DRmemo:=frxreport.FindObject('DateRangeMemo') as TfrxMemoView;
except
// trap
end;
try
This next line works
DRmemo.memo.clear;
This next line causes an Access Violation
DRmemo.Memo.Add(tmpstr);
except
// trap
end;
end;
FrxClientDataSet.Close;
FrxClientDataSet.CommandText:=cmdstr;
FrxClientDataSet.Open;
if FrxClientDataSet.RecordCount>0 then
begin
frxreport.LoadFromFile(appdir+cMDRaveReportPath+tmpstr+'.fr3');
tmpstr:='From '+formatdatetime('m/dd/yyyy',fromdatetimepicker.Date)+' to '+formatdatetime('m/d/yyyy',todatetimepicker.Date);
try
DRmemo:=frxreport.FindObject('DateRangeMemo') as TfrxMemoView;
except
// trap
end;
try
This next line works
DRmemo.memo.clear;
This next line causes an Access Violation
DRmemo.Memo.Add(tmpstr);
except
// trap
end;
end;