Hi,
Problem
if you associate a datasource for the resource table (and the property fields associated) to a DBWeekSource without a DBPlanner is connected to it, at run time the program raises an AV.
If you do the same with a DBDaySource, no problem.
Reason :
The method TDBDaySource.ConfigurePlanner(var Span: Integer) contains a guard code to verify that the component is assigned to a planner but the code is not not the TDBCustomPeriodSource.ConfigurePlanner
if not Assigned(FPlanner) then
Exit;
The lines FPlanner.Positions := NumberOfResources do an AV because FPlanner is nil.
Workaround:
When disconnecting the planner (or connecting TDBPlanner.Itemsource.DatasSource to an another DBSource) :
PlannerDB.ItemSource := DBDaySource1;
DBWeekSource1.ResourceDataSource.DataSource := nil;
when reconnecting:
PlannerDB.ItemSource := DBWeekSource2;
DBWeekSource1.ResourceDataSource.DataSource := DataSourceResource;
Cheers,
Nic