In my Lazarus Application i am tying to use the briefcase-Mode. I adapted the example and when i start the App without a app.briefcase Folder the Tables are downloaded. If i start the App again, i get a Memory Error…
procedure TDM.LoadData;
var
lbriefcaseName: string;
lbriefcase: TDAFolderBriefcase;
begin
AddToLog('Initial loading...');
AddToLog('Looking for the local briefcase first...');
lbriefcaseName := GetBriefcaseFileName;
AddToLog('Briefcase: '+ lbriefcaseName);
if not DirectoryExists(lbriefcaseName) then
begin
AddToLog('No briefcase found. Downloading fresh data...');
LoadFromServer;
end
else begin
AddToLog('Briefcase has been found.');
lbriefcase:= TDAFolderBriefcase.Create(lbriefcaseName,True,True); ///// The Error shows in this Line
if ValidateBriefcase(lbriefcase) then begin
GetTablesFromBriefcase(lbriefcase);
end
else begin
AddToLog('Clearing briefcase and downloading fresh data...');
LoadFromServer;
end
end;
AddToLog('Data is ready.')
end;
I use the newest Version and Lazarus 1.6
RemObjects Remoting SDK for Delphi - 9.1.100.1271.exe [Branch: gamma] — Wed, Oct 26, 2016
I can’t reproduce any problems with your briefcase:
I’ve used lazarus-1.6.0-fpc-3.0.0-win64.exe and this code:
procedure TForm1.Button1Click(Sender: TObject);
var
lbriefcaseName: string;
lbriefcase: TDAFolderBriefcase;
i: integer;
begin
AddToLog('Initial loading...');
AddToLog('Looking for the local briefcase first...');
lbriefcaseName := '..\Gideons.briefcase';
AddToLog('Briefcase: '+ lbriefcaseName);
try
lbriefcase:= TDAFolderBriefcase.Create(lbriefcaseName,True,True);
for i:=0 to lbriefcase.TableCount-1 do
AddToLog('tables: '+ lbriefcase.TableName[i]);
finally
lbriefcase.Free;
end;
end;
This Problem is real strange. // Checkt again for the Tables and you are right it has nothing to do with the Filter
If i just “load” 2 tables i get Also the Error ( always only the 2end Time i start up the App ) but i can work with the Briefcase and the Reports are relay fast compare to the Online Version…
Any hints how to get to the bottom of this Problem?
briefcase data is stored incorrectly for Lazarus if datWideString is used. this is related to recent fix that Lazarus uses UTF8 strings instead of pure Unicode strings.