Hi
I am tying to use the briefcase-Mode adopted sample application.
There are 2 tables loaded and saved to briefcase and 1 Clone table.
At some point having a strange situation, on LoadData procedure: 2 tables are loaded from briefcase, Clone table doesn’t show any data loaded.
To fix it I have to Invalidate briefcase and reload app again , then 2 tables are loaded from briefcase and Clone table shows data loaded and till the next restart. Next time when app launched , having same problem => no data in Clone table.
Same time if I’m running LoadFromServer ( directly, no briefcase) => Clone table shows data loaded ;
I have it checked on RO briefcase sample application, and it’s working as expected, which means that I have something messed up in my app, but could not find what may be the reason.
Just found that in case of Invalidate briefcase and reloading the app again, program running LoadFromServer procedure , which is direct call to server, that’s why data appears on Clone table.
LoadData taking it from briefcase and by some reason Clone table not able to display data from it.
Have LoadData modified accordingly , but no luck yet, still Clone not showing data, same time I can browse Briefcase data with DA Briefcase Explorer:
procedure TDM.LoadData;
var
lbriefcaseName: string;
lbriefcase: TDAFolderBriefcase;
begin
lbriefcaseName := GetBriefcaseFileName;
tbl_CloneTk.Filtered := false;
tbl_CloneTk.CloneSource := nil;
tbl_CloneTk.ClonedAutoOpen := false;
if not DirectoryExists(lbriefcaseName) then
begin
LoadFromServer;
end
else begin
lbriefcase:= TDAFolderBriefcase.Create(lbriefcaseName,True,True);
if ValidateBriefcase(lbriefcase) then begin
GetTablesFromBriefcase(lbriefcase);
showmessage('load from brcase');
end
else begin
LoadFromServer;
end
end;
tbl_CloneTk.CloneSource := tbl_MainTk;
tbl_CloneTk.ClonedAutoOpen := true;
end;
Sorry about that , it’s just too many fiddling done in app so far with custom filters and threaded updates , so this will take a while to strip it up.
I have concept of cloning tables tested on RO Briefcase sample and it’s working as expected, but when I have it in “real life” app , that’s where I have a hiccups.
Now one thing is to rewrite my app altogether from scratch and other approach knock off functions one by one till the moment of truth.
procedure TClientDataModule.GetTablesFromBriefcase(briefcase: TDABaseBriefcase);
begin
AddToLog('Loading tables from the briefcase...');
briefcase.Fill([tbl_StockTk],True);
Self.tbl_Clone.open; //<<<<<<<<<<<<<
end;